Archived

This topic is now archived and is closed to further replies.

Meanie

DInput problem

Recommended Posts

For some reason I am getting compiler errors in dinput.h and I end up getting the following errors C:\Studio\DXSDK\include\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800 C:\Studio\DXSDK\include\dinput.h(646) : error C2501: ''UINT_PTR'' : missing decl-specifiers C:\Studio\DXSDK\include\dinput.h(646) : error C2146: syntax error : missing '';'' before identifier ''uAppData'' C:\Studio\DXSDK\include\dinput.h(658) : error C2501: ''UINT_PTR'' : missing decl-specifiers C:\Studio\DXSDK\include\dinput.h(658) : error C2146: syntax error : missing '';'' before identifier ''uAppData'' C:\Studio\DXSDK\include\dinput.h(658) : error C2501: ''uAppData'' : missing decl-specifiers etc... InputDemo.obj - 12 error(s), 0 warning(s) Now they are the only errors I''m getting, and yes I have included dinput8.lib and dxguid.lib. The SDK is (supposedly) set up correctly cause I''ve had more success with directdraw Can someone tell me what I need to do now?

Share this post


Link to post
Share on other sites
Okay, I think I got it, I just had to add

#define DIRECTINPUT_VERSION 0x0700

before

I''m a litte unhappy with this because I also had to alter the DirectInput8Create() to work with the previous versions

I''ll probably figure this all out later after I get the app to work

Share this post


Link to post
Share on other sites
Okay, this is my new problem...

For some reason I can only use DirectInput3. If I try to use 5 or 7 the app crashes when it tries to run GetDeviceState() in the main game loop

ie #define DIRECTINPUT_VERSION 0x0700

I got these values from dinput.h, which also states that when it is not defined it is automatically set to 0x0800 for DirectInput8.

Fair enough, but trying to use DirectInput8 is even harder.

Whether I set #define DIRECTINPUT_VERSION 0x0800 or just remove the line, I get still get those 12 errors I mentioned from dinput.h

I''ve set dinput8.lib and changed DirectInputCreate to DirectInput8Create along with its extra parameters.

Can someone tell me what''s going on? I''ve gotten my code from TOTWGPG if that''s any help

Share this post


Link to post
Share on other sites
I remember some of these errors from when I was trying out dinput8 for the first time. So I checked a dinput sample and saw they included basetsd.h. I did this in my program and then it worked. Hope this helps!

Share this post


Link to post
Share on other sites
Thanks. I only just found that out on an old thread. Man, it seemed like it was such a major problem on the forum. It was really killing me too. At least it solves that problem at last.

Share this post


Link to post
Share on other sites