home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / mswindo / programm / misc / 3528 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  1.9 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!uwm.edu!biosci!agate!agate!muffy
  2. From: muffy@remarque.berkeley.edu (Muffy Barkocy)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: using global memory for controls
  5. Message-ID: <MUFFY.92Nov18151003@remarque.berkeley.edu>
  6. Date: 18 Nov 92 23:10:03 GMT
  7. Organization: Natural Language Incorporated
  8. Lines: 34
  9. NNTP-Posting-Host: remarque.berkeley.edu
  10.  
  11.  
  12. This is posted for a co-worker.  Please send all replies to:
  13.  
  14. paul@nli.com
  15.  
  16. Creating control windows uses memory from the local heap.  Because the
  17. local heap + stack + static variables is limited to 64k, the number of
  18. windows you can create is limited.
  19.  
  20. Is there any way to cause Windows to allocate memory for a control
  21. window from the global heap instead of the local heap?
  22.  
  23. Our specific situation: we use CreateWindow to create a (large) number
  24. of edit controls in a dialog box. The controls are actually children of
  25. a subwindow of a subwindow of the dialog box (i.e., they are two levels
  26. down in the window hierarchy) Eventually, depending on local memory use
  27. by other parts of our program, the CreateWindow fails when LocalAlloc
  28. runs out of memory.
  29.  
  30. I do not believe that using the DS_LOCALEDIT style matters (we are not
  31. using it). The problem seems to be with memory for the control, not
  32. memory for the text buffer. I also do not think this problem is specific
  33. to edit controls - I think it applies to all controls.
  34.  
  35. Our temporary solution is to make sure as much local heap is available
  36. as is possible. A better solution would be to get Windows to use memory
  37. from a data segment other than DGROUP. Is this possible???
  38.  
  39. --
  40.  
  41. Muffy Barkocy                               muffy@mica.berkeley.edu
  42. ~Weavers' fingers flying on the loom/patterns shift too fast to be
  43.  discerned/all these years of thinking/ended up like this/in front
  44.  of all this beauty/understanding nothing~ - Bruce Cockburn
  45.