XInput not working with multiple controllers

Started by
0 comments, last by marshdabeachy 15 years, 11 months ago
I've got an odd problem... XInput works, but only for one controller. For everything else it just gives me a ERROR_DEVICE_NOT_CONNECTED error. Code is rather basic, I'm just checking to see if the controller is there...

for (int i=0; i<4; i++)
{
  XINPUT_STATE temp;
  memset(&temp, 0, sizeof(XINPUT_STATE));
  DWORD result = XInputGetState(i, &temp);
  if (result == ERROR_SUCCESS)
  {
    // controller available
  }
}
Like I said, index 0 returns a result of 0 and can successfully get the controller's state. All other controllers (1-3) just return error code 1167... ERROR_DEVICE_NOT_CONNECTED. In Vista's gamepad manager, all controllers show up correctly and I can test them all with no problems. I'm using a USB wireless receiver to connect the controllers. Any ideas?
Advertisement
FYI for anyone else looking for a solution on this...

It turns out the DirectX SDK I was using was busted. I upgraded to the latest version (March 08) and now all the controllers work.

This topic is closed to new replies.

Advertisement