Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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
// 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);
Requirements
Header: afx.h