Article View: comp.os.ms-windows.programmer.misc
Article #2127using global memory for controls
From: Muffy Barkocy
Date: Wed, 18 Nov 1992 23:10
Date: Wed, 18 Nov 1992 23:10
34 lines
1973 bytes
1973 bytes
This is posted for a co-worker. Please send all replies to: paul@nli.com Creating control windows uses memory from the local heap. Because the local heap + stack + static variables is limited to 64k, the number of windows you can create is limited. Is there any way to cause Windows to allocate memory for a control window from the global heap instead of the local heap? Our specific situation: we use CreateWindow to create a (large) number of edit controls in a dialog box. The controls are actually children of a subwindow of a subwindow of the dialog box (i.e., they are two levels down in the window hierarchy) Eventually, depending on local memory use by other parts of our program, the CreateWindow fails when LocalAlloc runs out of memory. I do not believe that using the DS_LOCALEDIT style matters (we are not using it). The problem seems to be with memory for the control, not memory for the text buffer. I also do not think this problem is specific to edit controls - I think it applies to all controls. Our temporary solution is to make sure as much local heap is available as is possible. A better solution would be to get Windows to use memory from a data segment other than DGROUP. Is this possible??? -- Muffy Barkocy muffy@mica.berkeley.edu ~Weavers' fingers flying on the loom/patterns shift too fast to be discerned/all these years of thinking/ended up like this/in front of all this beauty/understanding nothing~ - Bruce Cockburn
Technical Details
Message-ID:
<MUFFY.92Nov18151003@remarque.berkeley.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!uwm.edu!biosci!agate!agate!muffyShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!uwm.edu!biosci!agate!agate!muffy From: muffy@remarque.berkeley.edu (Muffy Barkocy) Newsgroups: comp.os.ms-windows.programmer.misc Subject: using global memory for controls Message-ID: <MUFFY.92Nov18151003@remarque.berkeley.edu> Date: 18 Nov 92 23:10:03 GMT Organization: Natural Language Incorporated Lines: 34 NNTP-Posting-Host: remarque.berkeley.edu