Jump to content
  • Advertisement
Sign in to follow this  
Geronimo2000

C# DX crash on Present()

This topic is 4775 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

Here is a sequence of events that causes a mysterious crash (mysterious to me anyway). 1. Initialize D3D as normal in a C# project. 2. Display a message box with MessageBox.Show() for some error. (This step was just added recently). 3. Show the form that is associated with Direct3D. Now, when I call Present(), it will throw an exception with the message "Error in the application." I check TestCooperativeLevel and CheckCooperativeLevel, and both are successful at all times up to this point. The key to the problem is step 2. If I take it out, everything will work fine - it seems as though showing a message box before the main form is shown will do something bad, but I don't know how to remedy this or what is going on. I have had this project working for over a year, and this is something I haven't encountered before.

Share this post


Link to post
Share on other sites
Advertisement
try adding this in the control flags while initalizing the form u draw on, Controlstyles.EnableNotifyMessage.

Share this post


Link to post
Share on other sites
what that does, it enables you to see the message boxes in the form, when you use it to draw in Direct3D.
without it, you wouldnt be able to see the message boxes.
i thought that would be the case, but its not :)

maybe sample code would help.

Share this post


Link to post
Share on other sites
Well, I doubt this is it then since I could always see the MessageBoxes (with or without that style bit set). Thanks, though for the idea.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!