home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!mcsun!sunic!ugle.unit.no!humpty.edb.tih.no!fiero.edb.tih.no!lumina.edb.tih.no!ketil
- From: ketil@edb.tih.no (Ketil Albertsen,TIH)
- Subject: Re: How much memory is needed to run a program?
- Message-ID: <1992Aug12.092613.4229W@lumina.edb.tih.no>
- Sender: ketil@edb.tih.no (Ketil Albertsen,TIH)
- Organization: T I H / T I S I P
- References: <1992Aug11.180831.5010@fics.uucp>
- Posting-Front-End: Winix Conference v 92.05.15 1.20 (running under MS-Windows)
- Date: Wed, 12 Aug 1992 09:26:07 GMT
- Lines: 21
-
- In article <1992Aug11.180831.5010@fics.uucp>, ekl@fics.uucp writes:
-
- >I have a program that runs as a beauty under Windows 3.1, but
- >refuses to start under Windows 3.0, with windows giving the
- >message "Insufficient memory to run this application; close
- >one or more windows applications and try again".
- >[...]
- >Help About claims that there is 400+ K free memory, and 72%
- >free resources. Which roof am I hitting?
-
- Last time I experienced the same symptoms (and the time before that, and
- the one before that, and... blush!) the reason was that when registering
- the window class, I used a local wndclass struct, and forgot to set the
- cbClsExtra and cbWndExtra fields to zero. Being stack variables, the
- values were random, and usually quite large. When I was "lucky", the
- program would start, but a few operations later, the system would run
- out of memory.
-
- Most or all of the examples in the SDK use a dynamically allocated
- wndclass struct with zeroing of all fields at allocation time, so they
- do not have to explicityly zero the cbXxxExtra fields.
-