Problem with the WM_INPUT exemple

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
gmobile
Posts: 4
Joined: Thu Sep 18, 2008 8:54 pm

Problem with the WM_INPUT exemple

Post by gmobile »

Hi,

When i run your WM_INPUT exemple, GetRawInputData() fails on line 142 in WM_INPUTExample.cpp. The WM_INPUT method is the best way i can make use of a 3dx device in my application.

Is there a solution to this problem?


Thank you

Gabriel
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Works for me.

What error are you getting?

Which device do you have connected?

What O/S, version, etc. are you running?

Did you make any modifications to the demo?
gmobile
Posts: 4
Joined: Thu Sep 18, 2008 8:54 pm

Post by gmobile »

Hi,

I didn't make any modification to the code.
Im using the Space Navigator, O/S is Vista x64, and i compiled on VS2005.
GetRawInputData() returns -1 everytime I displace the cap.


I tried on Vista 32bit with the same hardware and its works. So i guess its a problem with the OS. Do you have any clue how i could fix that?

Much appreciated.

Gabriel
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Aha. I haven't tried that code on Win64.

Maybe RAWINPUTHEADER is a different size on Win64. You can call GetRawInputData with a null pointer to get the required size.
gmobile
Posts: 4
Joined: Thu Sep 18, 2008 8:54 pm

Post by gmobile »

You are right, of course, i just read :

"RAWINPUT is wrong (the fieldoffset(16)) because it wrongly assumes RAWINPUTHEADER being 16 bytes long on all platforms, while may be correct on 32 bit, it's 24 bytes on 64 bit. "

I'll try this as soon as i get home.

Thanks you
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

For everyone's information, the referenced link:

http://social.msdn.microsoft.com/forums ... 4947f4a009

Isn't the web a wonderful thing?!
Post Reply