能编译成功,但什么都不显示!
在windows程序设计第五版里有这样一个示例程序程序代码:
#include <windows.h> #include <tchar.h> #include <stdio.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 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; }
使用gcc编译能成功,但是运行什么都不显示,大家帮我看一下这是什么问题,谢谢!