• Advertisement
Sign in to follow this  

Managed DirectX Question

This topic is 4922 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 recently decided to try and learn a bit about managed DirectX and ran into a problem I can't seem to solve. When I try to set the cooperative level for a keyboard device I always get an InputException. As far as I can tell, I am following Tom Miller's code example exactly. Any ideas? Thanks all.
try
{
        device = new Device(SystemGuid.Keyboard);
	device.SetCooperativeLevel(this,CooperativeLevelFlags.Background | CooperativeLevelFlags.NonExclusive);
	device.Acquire();
}
catch (InputException e)
{
				
	MessageBox.Show(e.Message, "error");
		
}


Share this post


Link to post
Share on other sites
Advertisement
What is the exact debug output that you are getting? An InputException could be any number of things, so try to be more specific. Thanks.

Share this post


Link to post
Share on other sites
Hi all,

Unfortunately, InputException is the exact error. I am not getting one of the derived errors that inherits from InputException. I have placed catch blocks for all of the possible InputException types (and taken out the generic InputException) and I just get an "Exception not handled" error, so I have been unable to pin down exactly what it is complaining about.

The e.message message is simply "Error in application". I have even gone into the debugger and looked at every single field of e (boy there are a lot) and there is absolutly no message that is more specific as to what is wrong. They all just have this generic InputException.

"this" refers to the form. I have tried replacing it with the actual name of the form, but got the same results.

thanks again

Share this post


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

  • Advertisement