DialogBoxParam is fine...and can be used as you wish
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.
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
#define DialogBoxA(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
DialogBoxParamA(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
#define DialogBoxW(hInstance, lpTemplate, hWndParent, lpDialogFunc) \
DialogBoxParamW(hInstance, lpTemplate, hWndParent, lpDialogFunc, 0L)
#define DialogBox DialogBoxW
#define DialogBox DialogBoxA
#endif // !UNICODE
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
Cuz when you get that dialog working finally, you may find you cant get rid of it without the above code