I am using the method described here: http://www.codeproject.com/KB/cpp/exceptionlogging.aspx