I'm trying to use the following debug output function:
Code:
VOID
cdecl
CPSUIDbgPrint
(
LPSTR pszFormat,
...
)
/*++
Routine Description:
This fucntion output the debug informat to the debugger
Arguments:
pszFormat - format string
... - variable data
Return Value:
VOID
--*/
{
va_list vaList;
static TCHAR OutBuf[768];
#ifdef UNICODE
static WCHAR FormatBuf[256];
#endif
//
// We assume that UNICODE flag is turn on for the compilation, bug the
// format string passed to here is ASCII version, so we need to convert
// it to LPWSTR before the wvsprintf()
//
va_start(vaList, pszFormat);
#ifdef UNICODE
MultiByteToWideChar(CP_ACP, 0, pszFormat, -1, FormatBuf, COUNT_ARRAY(FormatBuf));
StringCchVPrintf(OutBuf, COUNT_ARRAY(OutBuf), FormatBuf, vaList);
#else
StringCchVPrintf(OutBuf, COUNT_ARRAY(OutBuf), pszFormat, vaList);
#endif
va_end(vaList);
OutputDebugString((LPTSTR)OutBuf);
OutputDebugString(TEXT("\n"));
}
The problem that I'm experiencing with this usage:
Code:
CPSUIDbgPrint("CPSUIFunc - Property Sheet Being Created");
is that I'm experiencing compiler error saying that it doesn't recognize what the code after this line is doing. Is there something fundamentally wrong on how I used the debug output (it looked like from the implementation to be used like a printf function or similar)?