bool DirectInputInit(){
HRESULT dirval;
dirval = DirectInputCreate((HINSTANCE)GetWindowLong(windowhandle,GWL_HINSTANCE), DIRECTINPUT_VERSION, &lpDI, NULL);
if( dirval != DI_OK) return(false);
dirval = lpDI->CreateDevice(GUID_SysKeyboard,&lpKeyboard,NULL);
if( dirval != DI_OK) return(false);
dirval = lpKeyboard->SetDataFormat(&c_dfDIKeyboard);
if( dirval != DI_OK) return(false);
dirval = lpKeyboard->SetCooperativeLevel(windowhandle,DISCL_EXCLUSIVE | DISCL_FOREGROUND);
if( dirval != DI_OK) return(false);
lpKeyboard->Acquire();
return(true);
};
DirectInput Linker errors.
Started by bosjoh, Oct 11 1999 06:40 PM
9 replies to this topic
#1 Members - Reputation: 122
Posted 11 October 1999 - 06:40 PM
I'm trying to create a directinput object and then creating a keyboard object. All fine, but the linker is giving 'unresolved reference' errors. I've included some code:
Sponsor:
#9 Members - Reputation: 152
Posted 11 October 1999 - 12:45 PM
You do not need to include the dxguid.lib
AND #define INITGUID as stated above. Just #define INITGUID would do in most cases. Adding the lib would only increase the size of your exe-file. Try without the lib, if it works then, do not use it.
AND #define INITGUID as stated above. Just #define INITGUID would do in most cases. Adding the lib would only increase the size of your exe-file. Try without the lib, if it works then, do not use it.
Christoffer Sandberg
todderod@algonet.se






