The Code Project Codejock Software - Serious GUI Code
Home >> Debug tips >> Unedited Reader Contributions

Navigate your TRACE outputs
By Wolfgang Busch

Extended TRACE macros with easy source navigation 
 Beginner
 VC5, VC6, Win95, Win98, NT4, W2K, MFC
 Posted 18 Oct 2000
 Updated 23 Oct 2000
Articles by this author
Send to a friend
Printer friendly version
[This is an unedited reader contribution] [Modify this article] [Delete this article]
Latest Articles Logon Message Boards Submit an Article
Broken links? Email us!
9 users have rated this article. result:
4.89 out of 5.

  • Download source files - 2 Kb
  • 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:
    1. If you want to use standard MFC TRACEs and XTRACEs side-by-side:

  • Add "xtrace.cpp" to your project.
  • Include "xtrace.h" in "stdafx.h".
  • Use TRACEx for standard MFC TRACEs and XTRACEx for navigatable TRACEs.

  • 2. If you want to navigate all TRACE outputs:
  • Add "xtrace.cpp" to your project.
  • Include "xtracestd.h" in "stdafx.h". This will replace all standard MFC TRACEx macros with XTRACEx macros.
  • Update (2000-10-23):

  • Evaluation of vargs in ExtTrace::Trace fixed
  • Macros are expanded to a single statement (using brackets and ',' operator)
  • Newline will be appended to trace message if necessary
  • Macros renamed from TRACE to XTRACE (to use simple MFC TRACEs and XTRACEs side-by-side)
  • Additional header "xtracestd.h" (include this header, if you want to replace all MFC TRACE macros with the according XTRACE macros)
  • [Top] Rate this Article for us!     PoorExcellent  
    Hint: For improved responsiveness, use Internet Explorer 4 (or above) with Javascript enabled, choose 'Dynamic' from the View dropdown and hit 'Refresh'
     Keyword Filter
     View   Per page   Messages since
    New threadMessages 1 to 9 of 9 (Total: 9)First | Prev | Next | Last
    Subject 
    Author 
    Date 
      Doesn't work on VC5
    Craig 4:15 24 Oct 00 
      Are you trying to make this too complex...
    Paul Westcott 18:24 23 Oct 00 
      Re: Are you trying to make this too complex...
    Wolfgang Busch 20:15 23 Oct 00 
      Re: Are you trying to make this too complex...
    Paul Westcott 12:42 24 Oct 00 
      Not allways work
    Yury Goltsman 10:55 22 Oct 00 
      Updated
    Wolfgang Busch 17:57 23 Oct 00 
      Doesn't work on VC6, SP4
    Craig 5:35 19 Oct 00 
      Bugfix
    Wolfgang Busch 6:24 19 Oct 00 
      Updated
    Wolfgang Busch 17:59 23 Oct 00 
    Last Visit: 12:00 Friday 1st January, 1999First | Prev | Next | Last

    Home >> Debug tips >> Unedited Reader Contributions
    last updated 23 Oct 2000
    Article content copyright Wolfgang Busch, 2000
    everthing else © CodeProject, 1999-2001.
    The Code Project Click here for Business Components Gallery Windows GUI solutions.