Article View: comp.windows.ms.programmer
Article #1651Re: CreateWindows() with BC++ gives exception 13 / error 0
From: Hans Kraft
Date: Thu, 14 Mar 1991 07:15
Date: Thu, 14 Mar 1991 07:15
14 lines
1154 bytes
1154 bytes
Don't put a pointer into the extra data area of a window, as that pointer could refer to a movable or even discadable segment. After reload or move of the according segment (done without notice by windows) the pointer is obsolete. It is better to allocate a segment (e.g. GlobalAlloc) and store the handle of the segment. Then lock (GlobalLock) the segment before use. You could also lock the segment after allocation and leave it locked for the application. Then you could store the pointer - but this is not recommended as it deteriorates windows memory management and it can give problems in some memory models. Hope this helps Giovanni Forza (Hans Kraft)
Technical Details
Message-ID:
<1991Mar14.071522.21044@ciba-geigy.ch>Path:
arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!cernvax!chx400!chx400!cgch!whkrReferences:
<21029@shlump.nac.dec.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!cernvax!chx400!chx400!cgch!whkr From: whkr@ciba-geigy.ch (Hans Kraft) Newsgroups: comp.windows.ms.programmer Subject: Re: CreateWindows() with BC++ gives exception 13 / error 0 Message-ID: <1991Mar14.071522.21044@ciba-geigy.ch> Date: 14 Mar 91 07:15:22 GMT References: <21029@shlump.nac.dec.com> Sender: Hans Kraft Organization: Ciba-Geigy AG, Basel, Switzerland Lines: 14 Nntp-Posting-Host: cgcha