Jump to content
  • Advertisement
Sign in to follow this  
Syranide

DirectInput goes Yoda (solved)

This topic is 4865 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

Ok, polling data works just fine... but... then I want to have buffered input from the keyboard... what does it give me? yoda! 0x80040207 The owner SID on a per-user subscription doesn't exist Come again? I looked at other peoples examples and they are next to identical. (Forgive my code for looking like Yoda but I hope you can understand eitherway)
IDirectInput8 *input;
IDirectInputDevice8 *keyboard;
DirectInput8Create(hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&input, NULL);
input->CreateDevice(GUID_SysKeyboard, &keyboard, NULL);

keyboard->SetDataFormat(&c_dfDIKeyboard);
keyboard->SetCooperativeLevel(hWnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE);

keyboard->Acquire();

DIPROPDWORD  dipdw; 

dipdw.diph.dwSize = sizeof(DIPROPDWORD); 
dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); 
dipdw.diph.dwObj = 0; 
dipdw.diph.dwHow = DIPH_DEVICE; 
dipdw.dwData = 10; 
keyboard->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph);

while(TRUE) {
    DIDEVICEOBJECTDATA rgdod[10];
    DWORD dwItems = 10; 

    // works
    keyboard->GetDeviceState(sizeof(char)*256, keybThis);
    // mumbo jumbo yoda return error
    keyboard->GetDeviceData(sizeof(DIDEVICEOBJECTDATA), rgdod, &dwItems, 0); 
}



(of course there are a lot more code in between but nothing that matters) But surely, such a return code doesn't really sound like DirectInput but some COM-related stuff microsoft invented just to piss random people off. Does anyone have the slighest idea to what could be wrong? [Edited by - Syranide on July 21, 2005 3:07:02 PM]

Share this post


Link to post
Share on other sites
Advertisement
What did any of that have to do with Yoda?

Anyways, DirectX (9) Error Lookup says:

HRESULT: 0x80040207 (2147746311)
Name: DIERR_NOTBUFFERED
VFW_E_NO_ACCEPTABLE_TYPES
Description: Attempted to read buffered device data from a device that is not buffered. & There is no common media type between these pins.
Severity code: Failed
Facility Code: FACILITY_ITF (4)
Error Code: 0x0207 (519)

Hopefully you will find that more helpful than the obviously screwy translation of the error code you have. Good luck...

Share this post


Link to post
Share on other sites
Oh, hehe, thought I could actually trust the internal interpreter in MSVC as it does pretty good with everything else.

Well, ok, than it's settled, a DirectInput error... however, why on earth can't I read buffered data from my keyboard then, isn't that something one should expect to be possible or am I out fishing?

EDIT: sorry, forget it, I misread the line saying SetProperty should be done after the device being acquired... but it really said shouldn't ;) So thanks mumpo

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!