TRACE2
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

TRACE2

The TRACE macros are obsolete, use ATLTRACE2.

See TRACE0 for a description of the TRACE2 macro.

TRACE2( 
   exp, 
   param1, 
   param2  
)

exp

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

param1

The name of the variable whose value should be dumped.

param2

The name of the variable whose value should be dumped.

// Example for TRACE2
int i = 1;
char sz[] = "one";
TRACE2( "Integer = %d, String = %s\n", i, sz );
// Output: 'Integer = 1, String = one'

// Another example for TRACE2
// Get major and minor version numbers of Windows
DWORD dwVersion = GetVersion();
DWORD dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
DWORD dwWindowsMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));

TRACE2("This is Windows version %d.%2.2d.\n", dwWindowsMajorVersion, dwWindowsMinorVersion);

Header: afx.h

Show:
© 2016 Microsoft