2014-02-22 67 views
0

我想一些sharpDX的例子,我; m得到这个“类未注册”。我从错误中找出它的一个东西,但我不明白为什么?我已经安装了sharpDX页面提到的DX运行时,并且我使用的是windows7 64.但这是一个win32应用程序。类没有注册的错误sharpDX

错误

An unhandled exception of type 'SharpDX.SharpDXException' occurred in SharpDX.dll 

Additional information: HRESULT: [0x80040154], Module: [SharpDX.DirectInput], ApiCode: [DIERR_DEVICENOTREG/DeviceNotRegistered], Message: Class not registered 


stack 
SharpDX.dll!SharpDX.Result.CheckError() + 0x42 bytes  
SharpDX.DirectInput.dll!SharpDX.DirectInput.DirectInput.CreateDevice(System.Guid arg0, out System.IntPtr arg1, SharpDX.ComObject arg2) + 0xee bytes 
    SharpDX.DirectInput.dll!SharpDX.DirectInput.Device.Device(SharpDX.DirectInput.DirectInput directInput, System.Guid deviceGuid) + 0x52 bytes 
    SharpDX.DirectInput.dll!SharpDX.DirectInput.CustomDevice<SharpDX.DirectInput.JoystickState,SharpDX.DirectInput.RawJoystickState,SharpDX.DirectInput.JoystickUpdate>.CustomDevice(SharpDX.DirectInput.DirectInput directInput, System.Guid deviceGuid) + 0x68 bytes 
    SharpDX.DirectInput.dll!SharpDX.DirectInput.Joystick.Joystick(SharpDX.DirectInput.DirectInput directInput, System.Guid deviceGuid) + 0x40 bytes 

代码: joystickState =新JoystickState(); Guid foundDevice = new Guid(); joystick = new Joystick(directInput,foundDevice);

回答

-1

您没有正确使用API​​。 Guid应该匹配已注册的DirectInput操纵杆Guid。仔细检查与此相关的示例JoystickApp

+0

examaple帮了很多thx。 – user2144480

+0

链接被破坏.... –