Win32 DialogBox problems
i''m having problems with setting up a simple dialog box under win with MSVC++6.
you can download my "project" here http://vesoljc.tripod.com/Download/DialogBox.zip
the problem is that my dialog box is not being drawn! only two default buttons (and other controls) are drawn, OK and CANCEL, no title, no borders, nothing.
here''s the main code:
#include "stdafx.h"
BOOL CALLBACK MyDlgProc(HWND hwnd, UINT Msg,WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_INITDIALOG:
Beep(1000,100);
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
Beep(500,100);
break;
case IDCANCEL:
EndDialog(hwnd,FALSE);
break;
}
}
return 1;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1),NULL, MyDlgProc);
return 0;
}
buttons work ok, but the dialog it self is not visible.
Abnormal behavior of abnormal brain makes me normal...
In your DlgProc, if you don''t handle a message you should be returning 0.
Your code currently returns 1 for *all* messages, it shoudln''t be!.
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Your code currently returns 1 for *all* messages, it shoudln''t be!.
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement