新建 common.h
#pragma once #include "atlstr.h" #include <time.h> #include <Windows.h> static void OutputDebugPrintf(const char* strOutputString, ...) { char strBuffer[4096] = { 0 }; va_list vlArgs; va_start(vlArgs, strOutputString); _vsnprintf_s(strBuffer, sizeof(strBuffer) - 1, strOutputString, vlArgs); va_end(vlArgs); OutputDebugString(CA2W(strBuffer)); }
使用:
include头文件
OutputDebugPrintf("FDASFDASFDASF");