Solved

How to capture TRACE macros

Posted on 1998-01-25
2
465 Views
Last Modified: 2013-11-20
How is it possible for an application to capture
TRACE mocros from an other application ?

I have try to use _CrtReportHook but this function only
capture the TRACE macros for his application and not for an other application (Both application are compiled in debug version) and I doesn't want to use MSVC++ 5.0 because on some machines I haven't install it.
0
Comment
Question by:mike_marquet
2 Comments
 
LVL 2

Expert Comment

by:chris_a
ID: 1314810
I use a program from MSJ called TRACEWIN written by Paul DiLascia. This seems to pick up stray debug messages from other applications so it might do what you want.

The gist of hooking the messages seems to be "afxDump.m_pFile = &theTracer;" which is in the header that you include in your c app.

You should be able to find this on the web someplace.

Chris
0
 

Accepted Solution

by:
petern012698 earned 50 total points
ID: 1314811
The TRACE macro uses the DebugOutputString WIN32 function call.  To capture this output you need to debugthe applciation to which you want to look at the trace and then call WaitForDebugEvent and handle the event type OUTPUT_DEBUG_STRING_EVENT and this will give you the string that has been written.
You normally create a seperate thread to wait for this event.
Regards
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question