DIPROPDWORD prop;
prop.diph.dwSize = sizeof(DIPROPDWORD);
prop.diph.dwHeaderSize = sizeof(DIPROPHEADER);
prop.diph.dwObj = 0;
prop.diph.dwHow = DIPH_DEVICE;
prop.dwData = INPUTBUFFERSIZE;
HRESULT error = lpKeyboard->SetProperty(DIPROP_BUFFERSIZE, &prop.diph);
if ((error != DI_OK) || (error != DI_PROPNOEFFECT))
//error code here
DirectInput SetProperty()
I have a problem with IDirectInputDevice8::SetProperty. It just fails everytime. Here´s the code:
In the DirectX documentation it says error can be one of the following if the function fails: DIERR_INVALIDPARAM, DIERR_NOTINITIALIZED, DIERR_OBJECTNOTFOUND, DIERR_UNSUPPORTED. I´ve checked this to but that´s not the case. It´s not DI_OK and it´s not one of the others. It just plain fails for some reason. And if I let the program run, it crashes when it reaches the call to IDirectInputDevice8::GetDeviceData. Probably because SetProperty failed earlier. Anyone know what could be wrong?
Your error checking has gone pear-shaped. You used OR when you meant AND. So, if you get DI_OK, then it won''t equal DI_PROPNOEFFECT, and it will go into your error code.
If you checked the error code and it wasn''t one of the "official" codes, then what was it?
If you checked the error code and it wasn''t one of the "official" codes, then what was it?
Thanks for the reply. I edited the code slightly when I posted it to make it easier to read and overlooked that ||. The actual error code looks like:
Anyway, it´s still failing but it´s not one of the DIERR_ codes that´s in the DX documentation. I saw now you can set the bufferpropertys with SetActionMap too, I´ll try that instead later.
if (error != DI_OK) if (error != DI_DIPROPNOEFFECT) // error handling
Anyway, it´s still failing but it´s not one of the DIERR_ codes that´s in the DX documentation. I saw now you can set the bufferpropertys with SetActionMap too, I´ll try that instead later.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement