Jump to content
  • Advertisement
Sign in to follow this  
Saucetenuto

DirectInput problem - IDirectInputDevice8::GetDeviceInfo always returns E_INVALIDARG

This topic is 4092 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 have an LPDIRECTINPUTDEVICE8 object 'device', that I'm using to talk to a gamepad plugged into my computer. I can do almost anything I want with it: acquire it, set cooperation levels, get input events, et cetera, but GetDeviceInfo() always returns DIERR_INVALIDPARAM. I'm calling it like so:
DIDEVICEINSTANCE device_info;
device_info.dwSize = sizeof(DIDEVICEINSTANCE);
r = device->GetDeviceInfo(&device_info);
According to the docs, I'm either not setting dwSize correctly or not initializing 'device' correctly, but dwSize gets set to 580 right there in the offending code and my input device struct works perfectly for everything else I try. Does anyone know what else might be wrong?

Share this post


Link to post
Share on other sites
Advertisement
i made one Semilier thing on DirectX use som Cooperatives that couldent work whit each other! look if its somthing whit those!

becus my program did get a fat error and shutdown it self!


dinkeyboard->SetCooperativeLevel(hWnd,
DISCL_NONEXCLUSIVE | DISCL_BACKGROUND);

Share this post


Link to post
Share on other sites
Well, it turns out that you can't call GetDeviceInfo() from within the EnumDevices () callback function. This isn't documented anywhere, and I can't see why it would be necessary, but there is is.

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!