Can't see Modal Dialogs

Started by
4 comments, last by GHoST 20 years, 1 month ago
I have a (non-mfc) win32 app that consists of a dialog as the initial parent window, another dialog as a child, and an opengl-ready non-dialog as another child. Whenever I attempt to display a modal dialog box (this includes MessageBox()) the modal dialog will not appear but I know it is present and active because I can bring it up if I press the Alt key.) If I hide the OpenGL child window first, then it will work correctly. Any thoughts as to what I can do about this? "That's a very nice hat." -Korben Dallas [edited by - GHoST on February 26, 2004 10:29:40 PM]
"That's a very nice hat."-Korben Dallas
Advertisement
Anyone?

"That''s a very nice hat."
-Korben Dallas
"That's a very nice hat."-Korben Dallas
First off, make sure you got #include "resource.h" at the top. Next check how your calling it, make sure your dialog box procedure is like this:

DialogBox(hInstance, MAKEINTRESOURCE(DB_ID), hWnd, DialogBoxProc)

If its not like this you get problems with the focus. DB_ID should be the ID of whatever the name of you dialog box is, like ''Steve'' or or IDD_DB1, whatever. If not then check your DialogBoxProc looks like this:

BOOL CALLBACK DialogBoxProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
return true;
case WM_COMMAND:
{
switch(LOWORD(wParam))
{
case IDOK:
{
EndDialog(hWnd, 0);
return true;
}
}
}
break;
}
return false;
}

If its not any of those then I''m stumped.
That is how I am doing it. I tried every possible option for the dialog that I could think of.

Oh, I have a little more info to add. Some dialogs appear correctly. The Common Open and Save file dialogs appears correctly. The Common Color dialog does not, however.


"That's a very nice hat."
-Korben Dallas

[edited by - GHoST on March 3, 2004 6:46:25 PM]
"That's a very nice hat."-Korben Dallas
If it is behind the OpenGL window then it may be appearing, but OpenGL is rasterizing over it. Try calling wglCurrentContext(null) when you create the window.
Good thought, but no luck. It''s got to be something along those lines though because as I said, if I hide the OGL window, there is no problem.

"That''s a very nice hat."
-Korben Dallas
"That's a very nice hat."-Korben Dallas

This topic is closed to new replies.

Advertisement