Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to capture TRACE macros

Posted on 1998-01-25
2
Medium Priority
?
470 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

670 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