Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Navigate your TRACE outputs

0.00/5 (No votes)
28 Jul 2001 1  
Extended TRACE macros with easy source navigation

Introduction

XTrace replaces the standard MFC TRACE macros. The macros implemented in XTrace.h add the file name and the line number of the trace point to any trace message (using the built-in __FILE__ and __LINE__ macros). A double click on the trace message in the debug window navigates to the according source line.

Usage

  • If you want to use standard MFC TRACEs and XTRACEs side-by-side:
    1. Add xtrace.cpp to your project.
    2. Include xtrace.h in stdafx.h.
    3. Use TRACEx for standard MFC TRACE's and XTRACEx for navigable TRACE's.

  • If you want to navigate all TRACE outputs:
    1. Add xtrace.cpp to your project.
    2. Include xtracestd.h in stdafx.h. This will replace all standard MFC TRACEx macros with XTRACEx macros.

Updates

2000-10-23

  1. Evaluation of vargs in ExtTrace::Trace fixed.
  2. Macros are expanded to a single statement (using brackets and ',' operator).
  3. Newline will be appended to trace message if necessary.
  4. Macros renamed from TRACE to XTRACE (to use simple MFC TRACE's and XTRACE's side-by-side).
  5. Additional header xtracestd.h (include this header, if you want to replace all MFC TRACE macros with the according XTRACE macros).

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here