Message Tracer | CodeGuru

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 […]

Written By
CodeGuru Staff
CodeGuru Staff
Aug 6, 1998
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

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

 MsgTracerLib.h
 MsgTracerLib.lib

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!

Advertisement

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

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.