Okay, I've only been trying to use the Win32 API for a short time but thought I was making great progress. Until now. I had written a small program in MSVC 6 that basically just displayed a modeless dialog (Or modal...I may have them backwards, but it's the one where the dialog doesn't have to be destroyed to return to the parent). It worked fine. Now I'm trying to do a real program and for some reason, I can't do the same thing. No matter what I try, I can't get a simple dialog to display. Message boxes are fine, but no dialogs. Instinct tells me that I have my dialog set up improperly but I can't find where and I really don't know for sure anyway. Here's some code :
The parent window itself displays fine. A great big white box. Yay.Code:LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CREATE: CreateDialog(myInstance, MAKEINTRESOURCE(IDD_MAIN), hwnd, MainProc); break; case WM_COMMAND: break; case WM_CLOSE: DestroyWindow(hwnd); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } return 0; } BOOL CALLBACK MainProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_INITDIALOG: return true; break; case WM_COMMAND: switch(LOWORD(wParam)) { } break; default: return false; break; } return true; }
Here's the bit of the .rc file with my dialog:
IDD_MAIN DIALOG DISCARDABLE 0, 0, 449, 206
STYLE WS_CHILD | WS_VISIBLE | WS_THICKFRAME
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Yeah, this blows.",IDC_STATIC,63,36,172,72
END
If you need more, just let me know.



LinkBack URL
About LinkBacks


