📄 stdafx.cpp
字号:
// stdafx.cpp : source file that includes just the standard includes
// speakerphone.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
void _debug(TCHAR *szFormat, ...)
{
TCHAR szBuffer[10240]; //in this buffer we form the message
const size_t NUMCHARS = sizeof(szBuffer) / sizeof(szBuffer[0]);
const int LASTCHAR = NUMCHARS - 1;
//format the input string
va_list pArgs;
va_start(pArgs, szFormat);
// use a bounded buffer size to prevent buffer overruns. Limit count to
// character size minus one to allow for a NULL terminating character.
_vsntprintf(szBuffer, NUMCHARS - 1, szFormat, pArgs);
va_end(pArgs);
//ensure that the formatted string is NULL-terminated
SYSTEMTIME pSystemTime;
GetLocalTime( &pSystemTime );
//write the file
FILE *f = _tfopen(TEXT("\\dbg_msg.txt"),TEXT("a"));
_ftprintf(f, TEXT("[%2d:%2d:%2d] %s\n"),
pSystemTime.wHour,
pSystemTime.wMinute,
pSystemTime.wSecond,szBuffer);
fclose(f);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -