Sign in to follow this  
Geronimo2000

C# DX crash on Present()

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this