direct input invalid access code
Hello everyone, I have a problem getting the input from the keyboard during the debug it always fails to do it. It gives me a message Invalid Access code... I don't know what that means. this is the code.
void WINAPI ProcessKBInput()
{
if (KeyInit==true)
{
hr = g_lpDIDevice->GetDeviceState(sizeof(buffer),(LPVOID)&buffer);
if FAILED(hr)
{
// If it failed, the device has probably been lost.
// Check for (hr == DIERR_INPUTLOST)
// and attempt to reacquire it here.
return;
}
and it is called here:
// Enter the message loop
MSG msg;
while( GetMessage( &msg, NULL, 0, 0 ) )
{
ProcessKBInput();
TranslateMessage( &msg );
DispatchMessage( &msg );
}
I'm not sure if here is where you are suppose to call it, please correct my mistakes... thank you.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement