nanogui: Using create structures.


Previous by date: 18 Jan 2000 17:16:34 -0000 Re: Length of Window extra bytes., Greg Haerr
Next by date: 18 Jan 2000 17:16:34 -0000 Fonts revisited, Vidar Hokstad
Previous in thread: 18 Jan 2000 17:16:34 -0000 Using create structures., Chris Johns
Next in thread:

Subject: RE: Using create structures.
From: Greg Haerr ####@####.####
Date: 18 Jan 2000 17:16:34 -0000
Message-Id: <C1962B36D9BBD311B0F80060083DFEFB0412D7@SYS.CenSoft.COM>

On Monday, January 17, 2000 9:22 PM, Chris Johns  wrote:
: Hi,
: 
: In `CreateWindowEx' the CREATESTRUCT is made a parameter with the
: following code :
: 
:  	/* note: the following assignment may have to change
: 	 * if the WINAPI decl changes from cdecl
: 	 */
: 	lpcs = (LPCREATESTRUCT)&dwExStyle;    <<<<<<<<<<<
: 	if(SendMessage(wp, WM_CREATE, 0, (LPARAM)(LPSTR)lpcs) == -1) {
: 		WndDestroyWindow(wp, FALSE);
: 		return NULL;
: 	}
: 
: Should this be :
: 
:  	/* note: the following assignment may have to change
: 	 * if the WINAPI decl changes from cdecl
: 	 */
: 	lpcs = (LPCREATESTRUCT) dwExStyle;  
: 	if(SendMessage(wp, WM_CREATE, 0, (LPARAM)(LPSTR)lpcs) == -1) {
: 		WndDestroyWindow(wp, FALSE);
: 		return NULL;
: 	}

No.  The first above is tricky code that takes the address of a stack
parameter and uses it as the address of a structure that includes
all those parameters.  Check out the CREATESTRUCT definition.

Greg

Previous by date: 18 Jan 2000 17:16:34 -0000 Re: Length of Window extra bytes., Greg Haerr
Next by date: 18 Jan 2000 17:16:34 -0000 Fonts revisited, Vidar Hokstad
Previous in thread: 18 Jan 2000 17:16:34 -0000 Using create structures., Chris Johns
Next in thread:


Powered by ezmlm-browse 0.20.