【发布时间】:2011-04-13 23:59:38
【问题描述】:
我在这个网站上阅读了很多关于同样问题的其他主题,我知道这很常见。但我想我很愚蠢,无法弄清楚正确的方法。所以,我为这些问题中的另一个问题道歉,我希望有人能给我一个简单的解决方案和/或解释。
这是完整的代码:
Main.c
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <stdlib.h>
#include <tchar.h>
LPTSTR GetApplicationPath ( HINSTANCE Instance );
int APIENTRY _tWinMain ( HINSTANCE Instance, HINSTANCE PreviousInstance, LPTSTR CommandLine, int Show )
{
LPTSTR sMessage = GetApplicationPath ( Instance );
MessageBox (
NULL,
sMessage,
_T ( "Caption!" ),
MB_OK
);
return 0;
}
LPTSTR GetApplicationPath ( HINSTANCE Instance )
{
_TCHAR sReturn[MAX_PATH];
GetModuleFileName ( (HMODULE) Instance, sReturn, MAX_PATH );
return sReturn;
}
【问题讨论】:
标签: c compiler-warnings