So I used a dialog box resource editor to create a template resource for my win32 application. I wrote this code:


#include<windows.h>
#include "resource.h" // defines DD_FORMVIEW


LRESULT CALLBACK DialogProcedure(HWND hdlg,UINT msg
WPARAM wparm, LPARAM lparm){
switch(msg){
case WM_COMMAND:
EndDialog(hdlg,0); // to end the dialog if a button is clicked
break;
default:
return DefDlgProc(hdlg,msg,wparam,lparam);
}
return 0;
}

int WINAPI WinMain(HINSTANCE hinst,HINSTANCE phinst,
LPSTR commline,int showstyle){
DialogBox(hinst,MAKEINTRESOURCE(DD_FORMVIEW),
NULL, (DLGPROC) DialogProcedure);
// the second parameter is my dialog box resource I created
// the third parameter (should be a window handle, but the
// application should consist only of the dialog box
return 0;
}


So: The application is built without complaints of compiler or linker. But starting the executable DOES NOT DISPLAY THE DIALOG BOX! Nothing happens. It seems the DialogBox function is totally ignored. If you could give me an example code of a working Dialog Box this would help me.