C# DX crash on Present()
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.
try adding this in the control flags while initalizing the form u draw on, Controlstyles.EnableNotifyMessage.
Thanks for the idea, but that didn't seem to do anything. Do you think it should for a specific reason?
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement