Microsoft Developer Network > Forums Home > Feedback and Discussions Forums > MSDN, TechNet and Expression Library Feedback > Raw Input x64 API Question - GetRawInputDeviceList call fails in Windows 7 x64

Proposed Answer Raw Input x64 API Question - GetRawInputDeviceList call fails in Windows 7 x64

  • Thursday, February 18, 2010 5:50 AM
     
     

    Hello,

    I'm porting a c# application developed on 32bit Windows 7 that interfaces with a USB scale to 64 bit Windows 7. The call to GetRawInputDeviceList fails with error code 87 "incorrect parameters." Specifically I used the following pinvoke prototype:

    [DllImport("User32.dll", SetLastError = true)]

     

    extern static UInt32 GetRawInputDeviceList(IntPtr pRawInputDeviceList,
    ref UInt32 puiNumDevices,
    UInt32 cbSize);

    I realize that IntPtr and cbSize are going to change between x32 and x64 howerever I am unable to find GetRawInputDeviceList 64 bit prototype.

    Yury 

All Replies

  • Thursday, September 23, 2010 8:03 PM
     
     Proposed Answer

    I got it working by building it as a 32 bit application.

    To do this, right click on the project, select properties, and go to the build tab. Change platform target from any to x86 to specify it as a 32-bit application.

    Might not be an ideal fix for you, but it's a lot better than saying 'this isn't the correct forum', especially when this is Google's first hit.

    • Proposed As Answer by Lazetti Thursday, September 23, 2010 8:03 PM
    •