When using the following code to call OutputDebugString on a Windows 7 box I only see "????" in the print column of DebugView. I think this may be an encoding related issue but not sure is anyone has seen this before. Here is the code I am using to call OutputDebugString.
void dbgprint(char *format, ...)
{
static DWORD pid=0;
va_list vl;
char dbgbuf1[2048],
dbgbuf2[2048];
// Prepend the process ID to the message
if ( 0 == pid )
{
pid = GetCurrentProcessId();
}
EnterCriticalSection(&gDebugCritSec);
va_start(vl, format);
wvsprintf(dbgbuf1, format, vl);
wsprintf(dbgbuf2, "%lu: %s\r\n", pid, dbgbuf1);
va_end(vl);
OutputDebugString(dbgbuf2);
LeaveCriticalSection(&gDebugCritSec);
}
Thanks in advance for any insight into this issue.