Sign in to follow this  
Jazonxyz

Access violation Message

Recommended Posts

Jazonxyz    138
I am tring to compile a game I am making but I keep on getting a message box after compiling it on Visual C++ 6.0 . The message reads: Unhandled exeption in Game.exe (D3D9.DLL): 0xC0000005: Access violation. What does this mean? How can I fix it?

Share this post


Link to post
Share on other sites
Driv3MeFar    1080
This means you are trying to access memory that doesn't belong to you. The most common culprit is dereferencing a NULL pointer. You should be able to drop into the debugger or step through your program at/up to the crash to see exactly what's going on.

Also, VC++ 6.0 is shit. Get 2005 Express Edition, it's free.

Share this post


Link to post
Share on other sites
Jazonxyz    138
I already have express editions 2005 but some commands don't really work like
when I type in:

hWnd = CreateWindow("Main","Title",100,100,...);

the compiler says that I cannot parameter 1 and 2 into some sort of format.

Share this post


Link to post
Share on other sites
Wolfdog    268
By default vs 2005 sets projects to use unicode character strings instead of multi-byte strings. You need to add L to the beginning of your string to make is unicode ie:

hWnd = CreateWindow(L"Main",L"Title",100,100,...);

Or you can use _T macro to change this based on the setting. So _T("Main") would work as well.

hWnd = CreateWindow(_T("Main"),_T("Title"),100,100,...);

Third option is to go into the project properties and set the string type to multibyte.

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