c# - DirectX DirectInput won't detect connected devices -


I'm trying to use a joystick in my C # WPF application using DirectX (Microsoft.DirectX .DirectInput;), but for some weird reasons I get an error in the first line, where I try to find out all connected devices. I have all the application codes in the constructor so far:

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

The error is as follows:

Error type: XamlParseException was unmanaged.

Error message: The constructor's voice on the "joystick test. Manwindo" type matches the specified compulsive barriers, threw an exception. 'Line number' 3 'and line position' 9 '. "

I am working with this example that I found online:

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

Here's late for the party but it's actually a bit darker to say it Are there. This is not controversial because you are using Direct In-Output Assembly (1.x) which puts your application into mixed-mode assemblies. You must add it to your app.config configuration node. Last, or it will continue to error from my experiences.

  & lt; Startup Usage Legacy V2RuntimeActivationPolicy = "true" & gt; & Lt; Supported serial version = "v4.0" /> & Lt; / Startup & gt;  

Key components Use Legacy V2RuntimeActivationPolicy = "true" - This allows your app to use older assemblies.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -