Trace
Visual C++ 2005 Express Edition + Platform SDK
Windowsアプリケーション
TRACEで出力可能なのは半角512文字まで!
マルチバイト文字セット
TraceMbcs
#include
void Trace(const char *pcFormat, ...); void Trace(const char *pcFormat, ...) { va_list args; char acBuf[512]; int iRet; va_start(args, pcFormat); iRet = vsprintf_s(acBuf, sizeof(acBuf), pcFormat, args); if (0 < iRet) { OutputDebugString(acBuf); } va_end(args); }
Unicode文字セット
TraceUnicode
#include
void Trace(LPCTSTR pcFormat, ...); void Trace(LPCTSTR pcFormat, ...) { va_list args; TCHAR acBuf[512]; int iRet; va_start(args, pcFormat); iRet = _vstprintf_s(acBuf, _countof(acBuf), pcFormat, args); if (0 < iRet) { OutputDebugString(acBuf); } va_end(args); } Trace(_T("lpCmdLine:%s\n"), lpCmdLine);