Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

TRACE2 

The TRACE macros are obsolete, use ATLTRACE2.

See TRACE0 for a description of the TRACE2 macro.


TRACE2(
      exp,
      param1,
      param2 
)

Parameters

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);
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.