I keep running in Access Violations while running through the DirectX 8 Init functions. Here is an example where I receive an 0xC0000005: Access Violation. Any one have an idea of what may be the cause?
Thanks,Code:// directinput globals LPDIRECTINPUT8 lpdi = NULL; // dinput object LPDIRECTINPUTDEVICE8 lpdikey = NULL; // dinput keyboard int DInput_Init_Keyboard(void) { // this function initializes the keyboard device // create the keyboard device // get 0xC0000005: Access Violation here if (lpdi->CreateDevice(GUID_SysKeyboard, &lpdikey, NULL) != DI_OK) { return(0); } // set cooperation level if (lpdikey->SetCooperativeLevel(main_window_handle, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND) != DI_OK) { return(0); } // set data format if (lpdikey->SetDataFormat(&c_dfDIKeyboard)!=DI_OK) return(0); // acquire the keyboard if (lpdikey->Acquire()!=DI_OK) return(0); // return success return(1); } // end DInput_Init_Keyboard
David