Hi,
I have been teaching myself to program in C++ with the goal of creating my own games and decided to try to create an OpenGL rendering engine by adapting the game engine I created for 2D games.
After reading up on the subject through a few tutorials I have created code which compiles without any errors, but crashes on running. I think the problem occurs when the application tries to register the window class after stepping through each line in debug. The error message that is generated says:
Unhandled exception at 0x7663d298 in OpenGL.exe: 0xC0000005: Access violation reading location 0xcdcdcdcd.
The code on the line that appears to generate the error is:
1 2 3 4 5
if (!RegisterClass (&wcWindowClass)) // Attempt to Register the Window Class
{
MessageBox (NULL, "Failed to Register the Window Class.", "ERROR", MB_OK | MB_ICONEXCLAMATION);
return FALSE;
}
This appears in a class function that is called into the WINAPI WinMain() function, defined in another class.
I would be greatful for any help you could provide.
Cheers, Hash.
I am going to be coding this stuff next semester so I am really interested but with this little snippet of code I have no idea were the problem is.
Access violation to me seems like a GNU compilers version of seg-fault so the error is probably somewhere else. Does the parameter for register class take a reference or pointer?
Sorry, my bad. I thought about posting more but I didn't want to clog up the thread.
It turns out that there is an unhandled exception with user32.dll, but I have no idea how to fix it.