vs2005だと問題なし
でもvs2017ではコンパイルエラーになります
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
int FormatMessageBox(TCHAR * szCaption, TCHAR * szFormat, ... )
{
TCHAR szBuf[1024];
va_list pList;
va_start(pList, szFormat);
_vsntprintf_s(szBuf, _ARRAYSIZE(szBuf), _TRUNCATE, szFormat, pList);
va_end(pList);
return MessageBox(NULL, szBuf, szCaption, MB_OK);
}
void FormatDebugString(TCHAR * szFormat, ... )
{
TCHAR szBuf[1024];
va_list pList;
va_start(pList, szFormat);
_vsntprintf_s(szBuf, _ARRAYSIZE(szBuf), _TRUNCATE, szFormat, pList);
va_end(pList);
OutputDebugString(szBuf);
}
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{
double hoge = 1.234567;
FormatMessageBox(TEXT("TEST"), TEXT("%f"), hoge);
FormatDebugString(TEXT("%f\n"), hoge);
return 0;
}
何かご存知の方おられましたら 宜しくお願い致します。