My experience with the Visual C++ Debugger is that it often hangs and is therefore a pain to work with. It's possible that it's hanging because of something that's wrong with my program, but I have tried to find and fix the problem (if there is one) and haven't succeeded.

Because of various problems I've encountered using the debugger, I started using a different approach. I define a class called Debug that has an overloaded output operator. I make an object of that class a global variable (called g_Debug) in my program so that it can be accessed from anywhere.

When I want to output a debug message, I use a statement like this:

g_Debug << "Debug message here" << varName;

The debug output stream goes to a file (debug.txt). I have changed the definition of SetError in engine.cpp so that it outputs error messages to the debug file instead of to the Visual C++ window.