Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to capture TRACE macros

Posted on 1998-01-25
2
Medium Priority
?
472 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

783 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