Skip to main content
gamedev.net
🔒 Locked

A Dinput wrapper func problem

Started by Solarbeam Oct 12, 2000 at 6:37 PM 5 replies 300+ views
Original Post
Solarbeam
Solarbeam
Ok, this is in my input wrapper class...as you can see, it was "cut-and-paste" code (*sigh*) HRESULT Get_KBinput(BYTE diks[]) { if(g_pdidDevice2) { HRESULT hr; hr = g_pdidDevice2->GetDeviceState( sizeof(diks), &diks ); // Check whether the input stream has been interrupted. If so, // re-acquire and try again. if( hr == DIERR_INPUTLOST ) { hr = g_pdidDevice2->Acquire(); if( FAILED(hr) ) return E_FAIL; } return S_OK; } } Its supposed to fill a var BYTE kb[256] with valid values; unfortunately, it doesnt fill it right if at all (it runs, though ) Thanks in advance
------------------------------Large explosion consumes building, hero walks away unharmed (wtf? why?) CUT
Coder10000
Coder10000
Have you checked if there is any succesful call to GetDeviceState?

Coder10000
Solarbeam
Solarbeam
Wow, 6 posts! O, ic, nm Well, anyway, im now checking for errors, but it still does the same thing! I want the function to change the value thats passed in; thats the problem, i think.
------------------------------Large explosion consumes building, hero walks away unharmed (wtf? why?) CUT
Solarbeam
Solarbeam
Um...(these kind of posts are prolly why im already a fanatic )
------------------------------Large explosion consumes building, hero walks away unharmed (wtf? why?) CUT
Solarbeam
Solarbeam
No one has any idea?
------------------------------Large explosion consumes building, hero walks away unharmed (wtf? why?) CUT
furby100
furby100
SeanHowe is right, you should just use 256 instead of that sizeof(diks) . sizeof(diks) only returns the size of a pointer (4 bytes). So you should make #define NUM_KEYS 256 and have that instead of the sizeof(diks), and you should also have it instead of 256 in your original declaration. Besides, unless your defining your own data format rather than using c_dfDIKeyboard there will always be 256 elements to the array.

------------------------------
#pragma twice


sharewaregames.20m.com

Topic Locked

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

Sign in to reply to this topic.