ddeham
Programmer
- Sep 30, 2005
- 11
I have an application with one window and a Compass button. I also created a dialog resource, with the ID "IDD_COMPASS". How do I open a dialog window with this resource when the user clicks the Compass button? Here is my command handler routine. This code does get executed when the user clicks the button. I just need some help fixing the code. Nothing happens when I click the button now. I'm using Microsoft eMbedded Visual C++ 4.0. Thanks.
Code:
//----------------------------------------------------------------------
// DoMainCommandCompass - Process DoMainCommandCompass command.
//
LPARAM DoMainCommandCompass (HWND hWnd, WORD idItem, HWND hwndCtl, WORD wNotifyCode)
{
HWND hwndChild;
if (wNotifyCode == BN_CLICKED)
{
hwndChild = CreateWindowEx (0, TEXT ("compassbox"),
TEXT (""), WS_EX_TOPMOST , 0,
0, CW_USEDEFAULT, CW_USEDEFAULT,
hWnd, (HMENU)IDD_COMPASS, hInst, NULL);
DialogBox(hInst,MAKEINTRESOURCE(IDD_COMPASS),hwndChild,CompassDlgProc);
}
return 0;
}