Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error from CreateDialog

Status
Not open for further replies.

LyMc

Programmer
Jun 3, 2003
84
US
The code:

Code:
	SetLastError (0);
	hWin = CreateDialog (thisDialog, MAKEINTRESOURCE (IDD_PT), pHdr->hTabs,
									(DLGPROC) (thisPage == 0 ? DlgSchemes : DlgPairs));

This occurs in the WM_NOTIFY code for a tabbed control. The tabbed control is created in the WM_INITDIALOG section, which them generates a message to WM_NOTIFY to create the first visible page on the tab control. pHdr->hTabs has the created tab control window handle (all this code is cribbed from the example in the MS help). The var thisDialog is the value that LoadLibrary for this DLL returned, IDD_PT has the constant 108 in it, pHdr->hTabs is the handle passed into the routine being executed (as a window callback), thisPage is 0, and DlgSchemes is the name of another callback; all are verified in the debugger. I get a zero returned for the dialog window handle, GetLastError tells me I have a 1400: bad Window handle. I checked out the value in pHdr->hTabs, and it is as it should be, and Spy++ says it's a valid window.

What arcanity have I tripped over this time?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top