Please Help (D3D C++ Low-Level)
Hello, I am a noob game programmer, and need help with a program in the tutorial book I bought that is not working. It will build without problems, however whenever I try to run it, it shows this error:
Unhandled exception at 0x0042712a in Paddle_Game.exe: 0xC0000005: Access violation reading location 0x00000000.
It tells me that the problem is most likely in these lines, however, I am not sure...
int Init_Mouse(HWND hwnd)
{
//set the data format for mouse input
HRESULT result = dimouse->SetDataFormat(&c_dfDIMouse);
if (result != DI_OK)
return 0;
If I have not posted enough for you to figure this out or you do know how to fix this, please reply.
Just for a heads up. since this is Directx 3d i suggest reposting or moving it to the Directx topic. And excuse my ignorance if the D3D stands for something else.
Quote:Original post by nintendomstr
Unhandled exception at 0x0042712a in Paddle_Game.exe: 0xC0000005: Access violation reading location 0x00000000.
"access violation" means a bad memory address.
Reading from address 0x00000000 generally means that a pointer has the value 0 (which is usually, if not always, invalid).
The only pointer in the code you posted is dimouse, so it is probably the invalid pointer. Set a breakpoint at the line with the error to see if that is the cause. Then find out why the pointer has an invalid value.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement