Originally posted by MrWizard
Try using DialogBox( ) function instead of DialogBoxParam( )..
DialogBoxParam is for Windows CE. DialogBox is the Win32 equivalent. If that does not work, try handling the WM_INITDIALOG case in your message proc, and using ShowWindow( ). I think it should work without that though.
DialogBoxParam is fine...and can be used as you wish
<secret>
In fact if out look at your include's the real truth might show that DialogBox is an imposter and uses DialogBoxParam to do the work
Code:
#define DialogBoxA(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
DialogBoxParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
#define DialogBoxW(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
DialogBoxParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
#ifdef UNICODE
#define DialogBox DialogBoxW
#else
#define DialogBox DialogBoxA
#endif // !UNICODE
</secret>
The code worked ok for me.....most probable that you havent included the resource in the project, or you are using the wrong ID (could DIALOG2 be DIALOG1???)
Also....add this to your dialog proc
Code:
switch(uMsg){
case WM_CLOSE:
EndDialog(hWnd,0);
return TRUE;
}
Cuz when you get that dialog working finally, you may find you cant get rid of it without the above code