Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual C++
Reference
Libraries Reference
MFC
Obsolete MFC Topics
 TRACE0
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
MFC Library Reference 
TRACE0 

The TRACE macros are obsolete, use ATLTRACE2.

TRACE0 is similar to TRACE and is one variant of a group of trace macros that you can use for debug output.

TRACE0(
      exp 
)

Parameters

exp

A format string as used in the run-time function printf.

The group includes:

  • TRACE0   Takes a format string (Only) and can be used for simple text messages, which are dumped to afxDump.

  • TRACE1   Takes a format string plus one argument (one variable that is dumped to afxDump).

  • TRACE2   Takes a format string plus two arguments (two variables that are dumped to afxDump).

  • TRACE3   Takes a format string plus three arguments (three variables that are dumped to afxDump).

TRACE0 does nothing if you have compiled a release version of your application. As with TRACE, it only dumps data to afxDump if you have compiled a debug version of your application.

NoteNote

This macro is available only in the debug version of MFC.

// Example for TRACE0
TRACE0( "Start Dump of MyClass members:" );

// Another example for TRACE0
// This works, but it is easier to use TRACE() or TRACE1()
DWORD dwLastError = ::GetLastError();
CString str;
str.Format("The last error code for this thread is %d\n", dwLastError);
TRACE0( (LPCTSTR) str);

// These are all normal uses of TRACE0()
TRACE0("This message will be output. ");
TRACE0("This text is on the same line.\n");
TRACE0("This text is on the next line.\n");
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker