Sign in to follow this  
nintendomstr

Please Help (D3D C++ Low-Level)

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this