Original Post
DirectInput8Create(h,DIRECTINPUT_VERSION,IID_IDirectInput8,(void**)m_pDI,NULL); if(FAILED(m_pDI->CreateDevice(GUID_SysKeyboard,&m_pDIKeyboard,NULL))) { MessageBox(NULL,"Error with keyboard","Info",MB_OK); }; m_pDIKeyboard->SetDataFormat(&c_dfDIKeyboard); m_pDIKeyboard->SetCooperativeLevel(m_window,DISCL_NONEXCLUSIVE|DISCL_BACKGROUND); m_pDIKeyboard->Acquire(); I have a problem with this code, as it throws a memory error when it runs.I think it has something to do with not creating DirectInput, from my own debugging.Can someone please help me and tell me whats wrong? Thanks in advance.