Now don't expect anything overly fancy. I'm not one for the debuggers that come with compilers. If you are, then go use them, as I'm sure they work better than this. However, if you are like myself, and either can't be bothered or find it difficult to learn how to use the debugger, then use these libraries. They are simple - very simple. Very simple indeed.
Now before you do too much more, head on over to http://www.sysinternals.com and download the DebugView program (unless you have WinNT/2K/Windows Developer version, in which case you probably already have a Microsoft product on your computer to do the same thing. I've got Win98 second edition, and it doesn't have one.) The DebugView program is essential to this process. What it does is intercepts the debugging messages that this puts out and displays them neatly. The program is a little clunky, but hey, it's free software, and it certainly (can) kill those bugs!!
Anyway, onto the usage. To send a debug message, simply use the functions with these prototypes:
Debug(char* Text);
Debug(char* Format, var_list Vars);
Now the top one simply puts text through. The second one works just like printf, but outputs to the debug list. Cool, simple, neat. So some examples would be like this:
Debug("That data's ok now.");
Debug("The handle to the window is %d.", Handle);
Debug("You passed the string, %s !", String);
Simple! Have fun! By the way, you can pass as many variables as you like, but you might like to keep them to a minimum, otherwise the lines are too long to read properly in the debugger. Enjoy!
To find out all the different escape codes (ie. %...), check out any documentation you have for printf(), as they are the same.
Now how do you quickly remove these debugging things for a final build, but leave them for later? Just #define F_NODEBUG before you include debug.h, and all of the debugging messages will no longer be printed!
| Back to index | The FreeFoote Foundation Classes Documentation |