Archived

This topic is now archived and is closed to further replies.

Lionheartadi

Program crashes when trying to get the device state of an mouse or keyboard in DX9.

Recommended Posts

Hi I have an odd problem. I use Direct Input for keyboard and mouse support and it works fine. You can move along the worlds look up and down etc, but then after a while the program crashes and when I intercept the crash with Visual Studio it shows me that when trying to get the keyboards or mouses state it crashes. Notice: It works fine for a while, but then suddenly crashes. Does might know why this occurs. I check the pointers and references to the device, but could not find any errors there. If anyone can give some tips, I will be gratefull. Thank you for any help.

Share this post


Link to post
Share on other sites
Have you used debug DirectX runtime to see what debug spew DirectInput writes? If the pointer to the device is still good, what''s the error code/exception code returned by GetDeviceState()?

Share this post


Link to post
Share on other sites
quote:
Original post by jacklin
Have you used debug DirectX runtime to see what debug spew DirectInput writes? If the pointer to the device is still good, what''s the error code/exception code returned by GetDeviceState()?



Ok stupid question, but how do I enable DirecX debug mode so that it works in VS .NET. I did install the Debug version of DX when I installed the SDK, but don''t yet know how to enable it. I allso did marked a debug stated in the controal panels DX optionsm, but well dunno...

Share this post


Link to post
Share on other sites
quote:
Original post by Lionheartadi
Ok stupid question, but how do I enable DirecX debug mode so that it works in VS .NET. I did install the Debug version of DX when I installed the SDK, but don''t yet know how to enable it. I allso did marked a debug stated in the controal panels DX optionsm, but well dunno...


If you have installed the DX SDK properly, go to the DirectX control panel applet, and open the DirectInput page. Select "Use Debug Version of DirectInput" and adjust "Debug Output Level" towards right. Then under Debug Output Generators, check IDirectInputKeyboard and IDirectInputMouse.

Now you should see debug output from DirectInput when debugging your program. If not, increase "Debug Output Level" further.

Share this post


Link to post
Share on other sites