Sign in to follow this  
bcs112

Problem using DirectInput in C gauge

Recommended Posts

Hi,I'm creating this gauge for my freeware panel which needs to read keyboard input directly into the gauge. In the great Dragonflight manual I found the cpp and h files and some instructions on how to set up the gauge, but when I compile in VC++6 I get compiler errors about LDIRECTINPUT not being properly declared or something.This question has been asked before in 2003 I think but I couldn't find the answer only that the user was able to fix the problem...Anybody here able to help me out ? Thx,Bj

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

You need some header files form the directx sdk, at least the "dinput.h". If you have the files already you'll probably need to add or shift the include/library directories under "extras->Directories" so the DirectX includes/libraries are higher then the default include paths.Arne Bartels

Share this post


Link to post
Share on other sites

Hi Arne,I'm not really sure what you mean with your answer. I shifted around the position of the header files in the c-codes and the errors during the compilation have gone but ow I get errors during the linking:"Linking... Creating library Release/BC_A300_FDATA.lib and object Release/BC_A300_FDATA.expBC_A300_FDATA.obj : error LNK2001: unresolved external symbol _FreeDirectInputBC_A300_FDATA.obj : error LNK2001: unresolved external symbol _CreatDirectInputDeviceBC_A300_FDATA.obj : error LNK2001: unresolved external symbol _GetFSWindowHandleRelease/BC_A300_FDATA.gau : fatal error LNK1120: 3 unresolved externalsError executing link.exe."I have included the necesarry lib files and dinput.h file etc... so everything should be in place. Does this ring any bells, can I maybe send you my source files so can have a look ?Thx for the help,Bj

Share this post


Link to post
Share on other sites

Did you add the "DInputKeyboard.cpp" to the project? It has to be compiled as a seperate module and then linked to the project. The simplest way is: open the gauge project, then open DInputKeyboard.cpp, then right click and chose "Add to project...".Arne Bartels

Share this post


Link to post
Share on other sites

Arne,The module is included in the project. I removed and put it back again the way you said but that gives the same result. Edit: 09:05 same day...Found it ! The DKeyboardInput.cpp file had the DKeyboardInput.h commented out... hadn't really noticed that. Now it works perfectly ! Thx again Arne for the support.Bj

Share this post


Link to post
Share on other sites

Hi,Where can I download "DInputKeyboard.cpp" and related files?Gabor

Share this post


Link to post
Share on other sites

sd2gau17.zip on flightsim.com is Dai Griffiths tutorial. "DInputKeyboard.*" are part of this as sample code.Arne Bartels

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this