By default, TRACE
calls OutputDebugString
.
You could use DebugView, which captures OutputDebugString
output and has an option to log it to a file.
It doesn't seem to be possible to directly send the output to a file other than by changing the application, e.g. by hooking the output with _CrtSetReportHook2
.
Internally, MFC uses _CrtDbgReport
to output its TRACE
messages. You can call _CrtSetReportMode
to specify where its output should go. Having done this you can call _CrtSetReportFile
to specify the win32 file handle (as returned by CreateFile
).