szLogPrintf

Description

szLogPrintf prints output from an auto test on the screen, in a log file, or both.

C Prototype

BOOL szLogPrintf(
lpSERVERINFO lpServer, /* Input:  Test information */
BOOL fForce, /* Input:  Force screen output */
LPSTR szFmt, /* Input:  Format string */
...); /* Input:  Arguments for format string */

Arguments

lpServer

The lpServer argument is a SERVERINFO structure containing information that includes the output window handle, the log file name, and where to send output. The SERVERINFO structure is defined in the AUTOTEST.H file. For information about the members of the structure, see the lpServer argument in AutoTestFunc.

When AutoTestFunc calls szLogPrintf, it should pass the value of lpServer that was passed to it by ODBC Test.

fForce

If TRUE, szLogPrintf writes the output to the screen regardless of the fScreen member of the lpServer argument. If FALSE, szLogPrintf writes the output to the screen only if the fScreen member of the lpServer argument is TRUE.

szFmt

A null-terminated format string compatible with the wsprintf function.

...

Arguments for the format string specified in the szFmt argument.

Return Value

TRUE if the function successfully logged the output; otherwise, FALSE. If FALSE is returned, a message box appears that allows the user to turn off logging.

Comments

Auto tests should call this function to log all output from tests.

Code Example

See AutoTestFunc.