Message Tracer

The purpose of MsgTrace is to display tracing output.

MsgTrace displays tracing output of any application that uses Win32’s OutputDebugString() function.
(e.g TRACE() macros, all MFC output, …)

MsgTrace can start monitoring the debug output of any running application.
An applications can initiate its monitoring or the monitoring can be started using the MsgTrace.

MsgTrace consists of the following projects

MsgTracer: The tracing program where all output is displayed

MsgTracerPS: A proxy/stub DLL to allow access to the tracing component from other applications

MsgTracerLib: A small static library that must be linked to debuggee applications that will
auto-attach to MsgTracer

MsgTracerTest: A small testing application that shows how to use MsgTrace

How to install MsgTrace

1. Copy the MsgTracer.exe and MsgTracerPS.dll onto your system
2. Register both executables:
   MsgTracer.exe /RegServer
   regsvr32 MsgTracerPS.dll

If you want to use the auto-attach feature copy inc/lib files


to a destiniation directory where your development environment can see them

Use MsgTrace with already built applications

1. Start debuggees that you want to monitor (MsgTrace can monitor as many debugees as you want)
2. Start MsgTracer.exe: the Tracer-Output-Window somes up and shows you an empty output list
3. Open processes dialog: either via menu [Tracing]/[Processes] or press on the monitor bitmap in the toolbar
4. Select process you want to monitor and press [Attach]

The process is attached to MsgTracer and shows all debugging output in the output list

Unfortunately you cannot detach anymore!

Use Auto-Attach-Feature with new applications

1. Include "MsgTracerLib.h"
2. Use the macro MSG_TRACE_ATTACHCURRENTPROCESS(); to automatically attach process to MsgTracer Use MSG_TRACE_WRITE( "Hello World" ); to trace the string "Hello World" Use MSG_TRACE_PRINTF( ( "Hello %d nd %s", 42, "World" ) ); to trace the string "Hello 42 nd World"
4. Link Debug version with MsgTracerLib.lib

Download source – 179 KB

Date Posted: 06.21.98

More by Author

Must Read