Sign in to follow this  
Saucetenuto

DirectInput problem - IDirectInputDevice8::GetDeviceInfo always returns E_INVALIDARG

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this