2009. 11. 2. 14:03

Implement TRACE

//MFC 환경이 아닌 곳에서 사용 가능

#include "stdafx.h"
#include "tchar.h"
#include <stdio.h>
#include <wchar.h>
#include <stdarg.h>
#include <winbase.h>
#include <vector>
#ifdef _DEBUG
void _trace( const TCHAR * format, ... )
{
va_list args;
va_start(args, format);
int len = _vsctprintf( format, args) + 1;

std::vector<TCHAR> buffer(len);
_vstprintf_s( &buffer[0], len,  format, args );

::OutputDebugString( &buffer[0] );

}
#endif //_DEBUG