Jump to content
  • Advertisement

Archived

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

atjs

Why wont my MessageBox show?

This topic is 5680 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''m writing a DirectX app. When an error occurs an exception is thrown and my ''catch {}'' handler should display a MessageBox. However, all I hear is the sound associated with the MessageBox style and the program just skips over the function. Any solutions?

Share this post


Link to post
Share on other sites
Advertisement
Hm. That didn''t work. Any other ideas?
I know this can also happen if I destroy a window just before I call MessageBox. Its happened before, but this time I''m sure I haven''t destroyed anything yet, since the window is still visible on the desktop.

Share this post


Link to post
Share on other sites
Put your window handle (hWnd) into for the HWND parameter...

[edit]note that this may not work in debug mode... but try it [/edit]

[edited by - Bullmax on January 30, 2003 11:23:26 PM]

Share this post


Link to post
Share on other sites
That didn''t work either. Has anybody else encountered a problem with MessageBox(es) not showing (and any solutions/suggestions?)

Share this post


Link to post
Share on other sites
I think the function you''re looking for is FlipToGdiSurface. I seem to recall an SDK sample dealing with this (and dialog boxes) but, for the life of me, can''t remember which one, (and I''m too pressed for time to do a Find in Files. )

Hope that helps,
-scott

Share this post


Link to post
Share on other sites
Maybe including MB_TOPMOST in the message box''s parameters will help.

------------------------------------------------------------
I am a signature virus. Please add me to your signature so that I may multiply.

Share this post


Link to post
Share on other sites
No, that didn''t help. Been trying for quite awhile now. Have no idea what is wrong. *confused*

Share this post


Link to post
Share on other sites
Still checking what''s wrong. (Pathetic, ain''t it?) Found that the MessageBox function is always returning the value IDOK. It''s as if the OK button is being pressed by default. As an alternative, I''ve tried to create a modal dialog using the DialogBox function. Surprise, it doesn''t work either, not displaying the dialog, and returning the value 1 as well.

Share this post


Link to post
Share on other sites
I always use this macro for sowing a messagebox. I''ve never had any problems with it:

#define MSGBOX(body) MessageBox(NULL,body,"MESSAGE",MB_OK);

you call it with MSGBOX("TEXT");

______________________________
"A computer is meant to be a big calculator, not a storage device"
Struct.m33p.net

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!