Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

GHoST

Can't see Modal Dialogs

This topic is 5220 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!