🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #1882

WinCreateWindow(...pCtlData,..) -> WM_CREATE problem

#1882
From: Fred Christianson
Date: Thu, 12 Nov 1992 11:06
30 lines
1654 bytes

--
 
I've had this happen in 3 programs I've writen, and now a coworker
just found it happening in his program.

I do a WinCreateWindow() and have the pCtlData parameter pointing
to an initialization structure.  When the window procedure gets
a WM_CREATE message, mp1 is supposed to have the pCtlData pointer, and
most of the time it does.  

But, about 1 in 5-10 times mp1 is not the same as the pointer I had in
WinCreateWindow().  Sometimes it has been 16 bytes off of the correct
pointer, but other times it looks nothing like the origional.  

I've tried having pCtlData point to a local, a global, and a malloc()'ed
structure, and they all do the same things.  

After this happens, WinGetLastError() returns 0x6000.

I've been getting around the problem by setting a global to what pCtlData
should point to, then using the global instead of mp1 in the message.
When I do that, everything works fine.  It also lets me compare the global
to mp1 in the WM_CREATE message, and put up a message box when they 
are different, which comes out to be 1 in 5-10 times.



Fred Christianson (fred@oneup.gwinnett.com)
Technical Details
Message-ID: <721566380fred.fred@oneup.gwinnett.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!emory!gwinnett!oneup.gwinnett.com!fred
References: <721564770fred.fred@oneup.gwinnett.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!emory!gwinnett!oneup.gwinnett.com!fred
From: fred@oneup.gwinnett.com (Fred Christianson)
Newsgroups: comp.os.os2.programmer
Subject: WinCreateWindow(...pCtlData,..) -> WM_CREATE problem
Summary: mp1 is not always pCtlData
Message-ID: <721566380fred.fred@oneup.gwinnett.com>
Date: 12 Nov 92 11:06:20 GMT
Article-I.D.: oneup.721566380fred.fred
References: <721564770fred.fred@oneup.gwinnett.com>
Sender: fred@oneup.gwinnett.com
Organization: One Up Corporation
Lines: 30