⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stdafx.cpp

📁 switch speaker on windows mobile platform
💻 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 + -