Jump to content
  • Advertisement

Archived

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

Ilankt

IDirectInputDevice8::SetDataFormat cause my program to quit...!

This topic is 5443 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

i really dont know why, but every time i''m usint IDirectInputDevice8::SetDataFormat, the program quits... no errors, she just quit... why??? here is all my code(as before):
if(FAILED(DirectInput8Create(g_hInst,DIRECTINPUT_VERSION,IID_IDirectInput8,(void**)&g_pDI,NULL)))
   {
      MessageBox(g_hWnd,"DI: 1","Error",MB_OK);
      return FALSE;
   }
   if(FAILED(g_pDI->CreateDevice(GUID_SysKeyboard,&g_pDIDevice,NULL)))
   {
      MessageBox(g_hWnd,"DI: 2","Error",MB_OK);
      return FALSE;
   }
  	if(FAILED(g_pDIDevice->SetDataFormat(&c_dfDIKeyboard)))//THIS CAUSE THE PROGRAM TO QUIT

	{
	   
      MessageBox(NULL,"DI: 3","Error",MB_OK);
		return FALSE;
	}
   if(FAILED(g_pDIDevice->SetCooperativeLevel(g_hWnd,DISCL_FOREGROUND | DISCL_NONEXCLUSIVE)))
   {
      MessageBox(g_hWnd,"DI: 4","Error",MB_OK);
      return FALSE;
   }
   if(FAILED(g_pDIDevice->Acquire()))
	{
		MessageBox(NULL,"DI:5",NULL,MB_OK);
		return FALSE;
	}

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!