现在做vc开发,经常需要在程序里输出测试信息,每一次,都要用CString类的Format函数,感觉特别不方便,网上找了下,貌似是普通字符的,没有对款字符串的统一函数,于是,就自己写了个函数,
#include "stdafx.h"
#include <stdarg.h>
void MyOutputDebugString(LPCTSTR lpszFormat, ...)
{
va_list arglist;
va_start(arglist, lpszFormat);
TCHAR outputstr[4095];
_vstprintf(outputstr, lpszFormat, arglist);
OutputDebugString(outputstr);
}
有需要的朋友可以拷过去测试下