try
{
device = new Device(SystemGuid.Keyboard);
device.SetCooperativeLevel(this,CooperativeLevelFlags.Background | CooperativeLevelFlags.NonExclusive);
device.Acquire();
}
catch (InputException e)
{
MessageBox.Show(e.Message, "error");
}
Managed DirectX Question
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.
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.
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement