Article View: comp.windows.ms
Article #225Re: GlobalCompact and Free Memory?
From: Brent Southard
Date: Mon, 19 Jun 1989 13:30
Date: Mon, 19 Jun 1989 13:30
27 lines
1774 bytes
1774 bytes
In article <246400012@uxa.cso.uiuc.edu> mms00786@uxa.cso.uiuc.edu writes:
>
>Hello.
>
>I just got started on Windows programming, and bought a copy of Petzold's book.
>As is my luck, I picked Freemem as the first program to try, and of course it
>doesn't work. I have 4 Megabytes of memory, and the MSDos Exec confirms this in
>the about dialog box. However, when I run FreeMem, it always tells me I have
>280 K of free memory. This is what GlobalCompact (0L) returns, even after I
>GlobalAlloc 280k! ...
I think you are confused about what GlobalCompact() returns. Global memory
in Windows is that memory within DOS' control, i.e. usually 640k. Since
DOS, drivers, Windows, and your application all eat up this memory, the 280k
amount you mention sounds accurate. Try running other applications at the
same time, and you will see FreeMem's number drop. In order for you to get
a more complete view of ALL free memory, you will need to call the
appropriate EMS functions. Ray Duncan's "Advanced MS DOS Programming" is a
good source for Expanded Memory details.
brent
--
brent southard (313) 656-8349 | oh mona mona
ImageTech Corp (313) 362-3141 | you can close your eyes
| i've got a twelve gauge surprise
usenet: ...!well!brent | waiting for you -- James Taylor
Technical Details
Message-ID:
<12271@well.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!apple!well!brentReferences:
<246400012@uxa.cso.uiuc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!apple!well!brent From: brent@well.UUCP (Brent Southard) Newsgroups: comp.windows.ms Subject: Re: GlobalCompact and Free Memory? Message-ID: <12271@well.UUCP> Date: 19 Jun 89 13:30:36 GMT References: <246400012@uxa.cso.uiuc.edu> Reply-To: brent@well.UUCP (Brent Southard) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 27