Archived

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

Forcas

Problem with DirectInput8Create

Recommended Posts

Forcas    181
I call the function like this:
  if(FAILED(DirectInput8Create(hMainInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, &lpdi, NULL));  
this is the error I get. C:\mssdk\samples\Multimedia\DDraw\src\dd7kikarse\main.cpp(137) : error C2664: ''DirectInput8Create'' : cannot convert parameter 4 from ''struct IDirectInput8A ** '' to ''void ** '' I copied that code right out of the SDK help file. WHat could be the problem? -Forcas
"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."

Share this post


Link to post
Share on other sites
Forcas    181
oh yeah.... I''ve got 3 closing parenthesis before the ;


-Forcas


"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."

Share this post


Link to post
Share on other sites
Forcas    181
Well now that I have that outta the way, I''ve got a new problem:
main.obj : error LNK2001: unresolved external symbol _DirectInput8Create@20
main.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A
Debug/dd7kikarse.exe : fatal error LNK1120: 2 unresolved externals

I copied the dinput.h file from my dx8/include directory to the vc/include directory. Same with Dinput.lib. ARghh... probably some .lib file that I don''t need to include?


-Forcas


"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."

Share this post


Link to post
Share on other sites
Forcas    181
Okay.... I added dinput8.lib to my project and got rid of the first error message, but now I still have this:

main.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A


-Forcas


"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."

Share this post


Link to post
Share on other sites
Liquid    122
#define INITGUID
once, and only once, before including any DirectX files. That should fix your problem.

Also, you should never copy files over the ones that came with your compiler. Instead, place all of the updated files in another directory
(like c:\Program Files\Microsoft Visual Studio\vc98\include\DX8) and go Tools->Options->Directories->Add and add the directory you put all the new stuff in to the list. You can then use the up and down arrow buttons to move the directory you just added up above the default MSVC include paths.

Liquid

Share this post


Link to post
Share on other sites
Liquid    122
Or, instead of #define INITGUID, you could just link with dxguid like Quantum suggested above. Make sure that the compiler is linking with the DX8 version though, and not the version that shipped with the compiler.

Liquid

Share this post


Link to post
Share on other sites