views:

70

answers:

0

I'm trying to use a joystick in my C# WPF application using directX (using Microsoft.DirectX.DirectInput;), but for some odd reason I keep getting an error in the first line where I try to detect all the connected devices. All I have in my application so far is the following line of code in the contructor:

DeviceList gameControllerList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly);

The error is as follows:

Error type: XamlParseException was unhandled.

Error Message: "The invocation of the constructor on type 'JoystickTest.MainWindow' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'."

I'm working off this example I found online: http://www.codeproject.com/KB/directx/joystick.aspx

My current setup is WPF, C#, .NET 4.0, and Windows 7 64-bit