在MFC工程(包括單文檔
#ifdef _DEBUG
void WINAPI DebugString(LPCSTR format
{
va_list arglist;
char buffer[
va_start (arglist
vsprintf(buffer
va_end (arglist);
strcat(buffer
OutputDebugString (buffer); }
#endif
代碼說明
char buffer[
測試代碼
#include <windows
#include <stdio
#ifdef _DEBUG
void WINAPI DebugString(LPCSTR format
{
va_list arglist; char buffer[
va_start (arglist
vsprintf(buffer
va_end (arglist);
strcat(buffer
OutputDebugString (buffer);
}
#endif
int main(int argc
int i;
for (i=
DebugString(
}
From:http://tw.wingwit.com/Article/program/net/201311/13758.html