Original Post
Hi. I'm trying to work out a class for Direct Input 8, and this requires me to pass the key buffer into the function to use GetDeviceState. Here's the code: Now if you're familiar with how GetDeviceState works, you'll see right off that this is how the function would take input if the character array was in the exact same function as GetDeviceState's call. But this time I'm passing it into the function. Now I'm checking the data on "keys", and none fo the values are changing. I'm breakpointing inside this function, and in fact "buffer"'s members amount to 1 entry: the number 0. I'm not sure exactly what's wrong here. All I do know is that this function is not changing the "keys" array. What can I do to fix this? note: I posted this in General Programming a little while ago, but I'm finding this to be a little more API specific.
void di8::getKeyboardState(char buffer[])
{
pdiDevice->GetDeviceState( sizeof(&buffer),(void*)&buffer);
};
//function call in WinMain:
char keys[256];
//... input is the name of my di8 class
input->getKeyboardState(keys);