qq_37362700
2017-10-16 18:07格式化的消息框_MessageBoxPrintf使用报错
//#include <stdio.h>
#include <windows.h>
int CDECL MessageBoxPrintf(TCHAR *szCaption,TCHAR *szFormat)
{
TCHAR szBUffer[1024];
va_list pArgList;
va_start(pArgList,szFormat);
_vsntprintf(szBUffer,sizeof(szBUffer)/sizeof(TCHAR),szFormat,pArgList);
va_end(pArgList);
return MessageBox(NULL,szBUffer,szCaption,0);
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd)
{
int cxScreen,syScreen;
cxScreen=GetSystemMetrics(SM_CXSCREEN);
syScreen=GetSystemMetrics(SM_CYSCREEN);
MessageBoxPrintf(TEXT("Scrnsize"),TEXT("the screen is %i pixels wide by %i pixels hight"),cxScreen,syScreen);
return 0;
}
- 点赞
- 回答
- 收藏
- 复制链接分享
0条回答
为你推荐
- springmvc使用ajax请求报错POST 415
- spring
- java
- ajax
- 2个回答
- Shiro框架报错:Authentication failed for token submission
- spring
- java
- eclipse
- 1个回答
- scrapy框架问题报错?
- python
- 1个回答
- 用intellij idea搭建ssm框架报错,请大神看看是怎么回事
- java
- intellij-idea
- spring
- tomcat
- 1个回答
- VS2010 MFC 对话框程序中的控件IDC_STATIC_DRAW1(Picture Control)图层问题
- c++
- 1个回答
换一换