The code:
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?
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?