Skip to main content
gamedev.net
🔒 Locked

Error with DirectInput

Started by dust_fr Jun 14, 2002 at 5:53 AM 3 replies 650+ views
Original Post
dust_fr
dust_fr
Hello all I''ve got a strange problem with Direct Input (DX8) for Acquiring keyboard, in windowed mode The init methods works fine but when i went to Acquire, i''ve got a message error ''Acess Denied'' (SetCooperativeLevel to FOREGROUND | NONEXCLUSIVE) This problem occurs under MFC application (under a win 32 prog i''ve not this pb....) Someone has an idea ???? thanks for any help :-) ps: I''m sorry for my poor writing english ;-)
IndirectX
IndirectX
Try the debug runtime.
---visit #directxdev on afternet <- not just for directx, despite the name
dust_fr
dust_fr
I set the "Debug output level" to max but i don''t understand the information (and it''s utility ;-)

DINPUT8: DIHid_BuildHidList(0)
DINPUT8: DIHid_CheckList(00000000)
DINPUT8: DIHid_CheckList(00000000) ->
DINPUT8: DIHid_BuildHidList(0) ->
DINPUT8: DIHid_GetDevicePath(00138948, 0012F474)
DINPUT8: DIHid_GetDevicePath(00138948, 0012F474) -> 00000001 OK
DINPUT8: DIHid_GetDevicePath(00138948, 0012F474)
DINPUT8: DIHid_GetDevicePath(00138948, 0012F474) -> 00000001 OK
DINPUT8: DIHid_BuildHidList(0)
DINPUT8: DIHid_BuildHidList(0) ->


"The access denied" error comes from HRESULT after call to
HRESULT hr = g_lpDIDevice->Acquire();

and it''s just says -> "Access is denied"
IndirectX
IndirectX
If you''re stepping through code, your app might not be in foreground and the acquire call might fail. Are you sure your application is the foreground and the active one when acquire is called?
---visit #directxdev on afternet <- not just for directx, despite the name
dust_fr
dust_fr
Big thanks it''s work

I have just to add "CWnd->SetFocus();" before the Dinput initialisation


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.