DirectInputCreate() Function Not Working!
I have tried and tried, but it doesn''t work. I downloaded the needed files from NeHe''s website. When I do this:
hr= (DirectInputCreate(GetModuleHandle(0), DIRECTINPUT_VERSION, IID_IDirectInput, (void**)&lpdi, NULL));
I get the error:
63 dinput_test.cpp
cannot convert `IID_IDirectInputA'' from type `const GUID'' to type `IDirectInputA **''
I hope you can help!
If thispost = 0 Then
GoBack()
Else
Read()
End If
I'll have a link to the TriFaze website as soon as possible. It's still currently being designed, by myself of course! =) I'll update the URL and my signature as soon as possible.Feel free to send me a message on Yahoo! or AOL IM™. =)
Here's my DirectInputCreate call in my game that works. I haven't spent much time with DirectInput except getting it up and making a wrapper so I can check for toggled keys instead of it just being pressed down.
Heres the code:
the #define is within my precompiled header, because if I want to use dinput 7, while using the dx8.1 sdk, you must #define the version before the include.
- Kevin "BaShildy" King
Game Programmer: DigiPen
www.mpogd.com
[edited by - BaShildy on April 13, 2002 2:09:45 PM]
Heres the code:
#define DIRECTINPUT_VERSION 0x700
DirectInputCreateEx(hinstance, DIRECTINPUT_VERSION, IID_IDirectInput7, (void **)&pDI, NULL);
// pdi is of type LPDIRECTINPUT7
the #define is within my precompiled header, because if I want to use dinput 7, while using the dx8.1 sdk, you must #define the version before the include.
- Kevin "BaShildy" King
Game Programmer: DigiPen
www.mpogd.com
[edited by - BaShildy on April 13, 2002 2:09:45 PM]
- Kevin "BaShildy" KingGame Programmer: DigiPenwww.mpogd.com
Now it gives me linker errors:
c:\opengl\dinput\dinput_test.o(.text+0x128):dinput_test.cp: undefined reference to `IID_IDirectInput7A''
c:\opengl\dinput\dinput_test.o(.text+0x142):dinput_test.cp: undefined reference to `DirectInputCreateEx@20''
c:\opengl\dinput\dinput_test.o(.text+0x15f):dinput_test.cp: undefined reference to `c_dfDIKeyboard''
the c_dfDIKeyboard part comes from:
hr= (lpdiKB->SetDataFormat(&c_dfDIKeyboard));
If thispost = 0 Then
GoBack()
Else
Read()
End If
c:\opengl\dinput\dinput_test.o(.text+0x128):dinput_test.cp: undefined reference to `IID_IDirectInput7A''
c:\opengl\dinput\dinput_test.o(.text+0x142):dinput_test.cp: undefined reference to `DirectInputCreateEx@20''
c:\opengl\dinput\dinput_test.o(.text+0x15f):dinput_test.cp: undefined reference to `c_dfDIKeyboard''
the c_dfDIKeyboard part comes from:
hr= (lpdiKB->SetDataFormat(&c_dfDIKeyboard));
If thispost = 0 Then
GoBack()
Else
Read()
End If
I'll have a link to the TriFaze website as soon as possible. It's still currently being designed, by myself of course! =) I'll update the URL and my signature as soon as possible.Feel free to send me a message on Yahoo! or AOL IM™. =)
Makes your post fun to read when your signature is in psuedo code right next to actual code :/
You need to link dinput.lib and dxguid.lib inside your project (or mak file). MSDN has the necessary library includes on most directX stuff, but sometimes forgets to include dxguid.lib for the #defines commonly used with certain functions.
- Kevin "BaShildy" King
Game Programmer: DigiPen
www.mpogd.com
You need to link dinput.lib and dxguid.lib inside your project (or mak file). MSDN has the necessary library includes on most directX stuff, but sometimes forgets to include dxguid.lib for the #defines commonly used with certain functions.
- Kevin "BaShildy" King
Game Programmer: DigiPen
www.mpogd.com
- Kevin "BaShildy" KingGame Programmer: DigiPenwww.mpogd.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement