Click here to Skip to main content
11,925,896 members (59,684 online)
Click here to Skip to main content
Add your own
alternative version


28 bookmarked

Navigate your TRACE outputs

, 28 Jul 2001 CPOL
Rate this:
Please Sign up or sign in to vote.
Extended TRACE macros with easy source navigation


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.


  • 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.



  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).


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Wolfgang Busch
Software Developer
Germany Germany
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralDoesn't work on MSVC++.NET Pin
Anonymous16-Jul-02 22:55
sussAnonymous16-Jul-02 22:55 
GeneralDoesn't work on VC5 Pin
Craig23-Oct-00 23:15
sussCraig23-Oct-00 23:15 
GeneralRe: Doesn't work on VC5 Pin
Anonymous10-Nov-01 7:26
memberAnonymous10-Nov-01 7:26 
GeneralAre you trying to make this too complex... Pin
Paul Westcott23-Oct-00 13:24
sussPaul Westcott23-Oct-00 13:24 
GeneralRe: Are you trying to make this too complex... Pin
Wolfgang Busch23-Oct-00 15:15
sussWolfgang Busch23-Oct-00 15:15 
GeneralRe: Are you trying to make this too complex... Pin
Paul Westcott24-Oct-00 7:42
sussPaul Westcott24-Oct-00 7:42 
GeneralNot allways work Pin
Yury Goltsman22-Oct-00 5:55
sussYury Goltsman22-Oct-00 5:55 
GeneralUpdated Pin
Wolfgang Busch23-Oct-00 12:57
sussWolfgang Busch23-Oct-00 12:57 
GeneralDoesn't work on VC6, SP4 Pin
Craig19-Oct-00 0:35
sussCraig19-Oct-00 0:35 
GeneralBugfix Pin
Wolfgang Busch19-Oct-00 1:24
sussWolfgang Busch19-Oct-00 1:24 
GeneralUpdated Pin
Wolfgang Busch23-Oct-00 12:59
sussWolfgang Busch23-Oct-00 12:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151126.1 | Last Updated 29 Jul 2001
Article Copyright 2000 by Wolfgang Busch
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid