Solved

How to capture TRACE macros

Posted on 1998-01-25
2
460 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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now