Skip to main content
GameDev.net gamedev.net
🔒 Locked

Help: DirectInput init problems!?!

Started by azariahsmith Jun 9, 2002 at 12:22 AM 1 replies 450+ views
Original Post
azariahsmith
azariahsmith
Hey. I''m trying to initialize DirectInput to use the keyboard. I''m getting the following unresolved external symbols and I don''t know why: _GUID_SysKeyboard _IID_IDirectInput8A _GUID_Key I have included "dinput.h" and I link "dinput8.lib". My short initialization function is below. The parameters ''hwnd'' and ''hInstance'' are initialized ok. Why am I getting these linking errors? email me at michael@engr.mun.ca if possible. Thanks in advance. -mike -=* CODE *=- LPDIRECTINPUT8 gDI; // DirectInput interface LPDIRECTINPUTDEVICE8 gDIKeyboard; // Keyboard device bool InitDirectInput(HWND hwnd, HINSTANCE hInstance) { // create the DirectInput object if (FAILED(DirectInput8Create(hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&gDI, NULL))) return false; // create the keyboard device if (FAILED(gDI->CreateDevice(GUID_SysKeyboard, &gDIKeyboard, NULL))) return false; // set the keyboard data format if (FAILED(gDIKeyboard->SetDataFormat(&c_dfDIKeyboard))) return false; // set cooperative level if (FAILED(gDIKeyboard->SetCooperativeLevel(hwnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE))) return false; // gain access to keyboard gDIKeyboard->Acquire(); return true; }
azariahsmith
azariahsmith
Never mind. I got it solved. I didn''t define INITGUID first.

-m

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.