home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / mswindo / programm / misc / 1323 < prev    next >
Encoding:
Text File  |  1992-08-13  |  1.6 KB  |  34 lines

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