• Advertisement
Sign in to follow this  

Function call problems

This topic is 4947 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I use this code:
	DirectInput8Create(hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&pDI, NULL);

	pDI->CreateDevice(GUID_SysKeyboard, &pDID, NULL); 

	pDID->SetDataFormat(&c_dfDIKeyboard); 

	pDID->SetCooperativeLevel(hWnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); 

	if (pDID) 
		pDID->Acquire(); 

it works fine, but when I put it in this function:
void InitKeyboard(HINSTANCE hInstance)
{
	DirectInput8Create(hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&pDI, NULL);

	pDI->CreateDevice(GUID_SysKeyboard, &pDID, NULL); 

	pDID->SetDataFormat(&c_dfDIKeyboard); 

	pDID->SetCooperativeLevel(hWnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); 

	if (pDID) 
		pDID->Acquire(); 
}

I get this error: winmain.obj : error LNK2019: unresolved external symbol "void __cdecl initKeyboard(struct HINSTANCE__ *)" (?initKeyboard@@YAXPAUHINSTANCE__@@@Z) referenced in function _WinMain@16

Share this post


Link to post
Share on other sites
Advertisement
Note: InitKeyboard vs initKeyboard

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement