Can not debug a crash
I'm using MSVC++ 6 to create a program using c. I get a crash when I do a specific action (in this case : click on the console window when my openGL window is open).
Normally I detect crashes by printing to the console to find where the crash occurs. The weird thing is that in this case the program fails to crash when I periodically print something to the console. I also tried the debugger in MSVC, but my debug build fails to crash too.
Does anyone have an idea how to solve this ? Is there an easy way to get a back-trace of the call stack ?
go to your event handler and manually trace the actions that take place. try adding MessageBox es and stuff places. Put in debug assertions for things you "know" to work.
Also bear in mind that the cause (where the bug really is), and effect (where it shows up) are not necessarily in the same place, especially if memory corruption is at work.