TRACE0  Home
This page is specific to:.NET Framework Version:1.12.03.54.0
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.

Remarks

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

// 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");
See Also

Reference

TRACE
TRACE1
TRACE2
TRACE3

Concepts

MFC Macros and Globals

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View