TRACE0

TRACE0(exp)

Parameters

exp

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

Remarks

TRACE0 is similar to TRACE, and is one variant of a group of trace macros that you can use for debug output. 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 which is dumped to afxDump)

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

  • TRACE3 - Takes a format string plus three arguments (three variables which 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.

Note   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   TRACE, TRACE1, TRACE2, TRACE3