#include <windows.h>
#include <tchar.h>
#include <stdio.h> int CDECL MessageBoxPrintf (TCHAR * szCaption, TCHAR * szFormat, ...) ??????????????
{
TCHAR szBuffer [1024] ;
va_list pArgList ; // The va_start macro (defined in STDARG.H) is usually equivalent to:
// pArgList = (char *) &szFormat + sizeof (szFormat) ; va_start (pArgList, szFormat) ; // The last argument to wvsprintf points to the arguments _vsntprintf (szBuffer, sizeof (szBuffer) / sizeof (TCHAR),
szFormat, pArgList) ; // The va_end macro just zeroes out pArgList for no good reason va_end (pArgList) ; return MessageBox (NULL, szBuffer, szCaption, 0) ;
}int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
int cxScreen, cyScreen ; cxScreen = GetSystemMetrics (SM_CXSCREEN) ;
cyScreen = GetSystemMetrics (SM_CYSCREEN) ; MessageBoxPrintf (TEXT ("ScrnSize"),
TEXT ("The screen is %i pixels wide by %i pixels high."),
cxScreen, cyScreen) ;
return 0 ;
}
这段程序的 int CDECL MessageBoxPrintf (TCHAR * szCaption, TCHAR * szFormat, ...) 是什么意思小弟 就是看不明白 ?
解决方案 »
- 插入符不显示
- 关闭对话框,主界面也关闭,程序退出,没有添加程序退出消息映射,请教原因
- VC6的project中project类型减少了 怎么改回来
- 各位兄弟,100分求类似windows优化大师界面的代码,Thank You
- CDialog里OK,Cancel,Apply,Help按钮Caption名称能随系统变动自动获得吗?
- 估计太难了,DuplicateHandle在98下的问题
- 急,简单在线等
- 怎样用vb 对spl表中的数据 进行条件查询?
- 刚买了《COM本质论》,一口气读了一半,一下子明白了很多概念的实际意义
- 谢谢
- 谁知道个 IPropertyBag Interface 有什么用?
- 大家来帮我看看为什么我的这个程序执行时出错,闷啊!
例如printf() 它的定义是这样的:
int printf( const char* format, ...);
比如,本来要写两句:
char ch[100];
sprintf(ch,"The screen is %i pixels wide by %i pixels ",cxScreen,cyScreen);
然后MessageBox(NULL, ch, szCaption, 0);
现在将这两个操作打包到一个函数中。就是所谓的MessageBoxPrintf了