Jump to content
  • Advertisement
Sign in to follow this  
ferr

DInput Poll Error

This topic is 4646 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'm attempting to Poll a joystick device and I get the error "Access code is invalid." When attempting to re-acquire the device right after this failure I get "E_ACCESSDENIED." The device passes all null tests so I think it's a valid device, and my joypad works fine with the DX SDK sample. Any ideas? BTW, I am integrating it into Ogre3D, one of the odd things about that is that I have to go through some odd process to get a proper HWND to pass into my InitDirectInput, maybe that's a clue as to what the problem is.

Share this post


Link to post
Share on other sites
Advertisement
Still trying to find a solution for this.. I've run through every process in debug and I get S_OK on everything until I try to Acquire or Poll. I think I might just give up on DInput and switch to SDL's input if no one replies today.

Share this post


Link to post
Share on other sites
Quote:
Original post by Aiursrage2k
I have done something similar using ogre and directinput... I suspect you are not getting the hwnd properly. I can post some code tommorow.


Yeah, I used your thread over on the Ogre forums to find out how to get the HWND properly, I'm using Sinbad's solution:

mWindow->getCustomAttribute("HWND",&hWND);

It seems to get it properly, it returns S_OK's when using the handle in the input init. I think my problem is that I don't know at what point to acquire and poll (I can't find any documentation for integrating DInput into Ogre!) Just a few minutes ago I modified the DX SDK's code to acquire/poll around the same time I was doing it in my Ogre program and it gave me the same errors.

Share this post


Link to post
Share on other sites
Hey ferr,

Not sure if this may have something to do with your problem
Quote:

DIERR_OTHERAPPHASPRIO
Another application has a higher priority level, preventing this call from succeeding. This value is equal to the E_ACCESSDENIED standard DirectInput return value. This error can be returned when an application has only foreground access to a device but is attempting to acquire the device while in the background.


Have you tried setting your cooperation levels to DISCL_BACKGROUND instead of DISCL_FOREGROUND? this will allow DirectInput to aquire the device at any time.

Hope this helps

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.

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

Sign me up!