ANSI与UNICODE


#ifdef _UNICODE
wstring CPATH::GetExeName()
{
 wchar_t ExePath[MAX_PATH];
 GetModuleFileNameA(NULL,ExePath,sizeof(ExePath));
 return ExePath;
}
#else
string CPATH::GetExeName()
{
 char ExePath[MAX_PATH];
 GetModuleFileNameA(NULL,ExePath,sizeof(ExePath));
 return ExePath;
}
#endif
#ifdef _UNICODE
wstring CPATH::GetExeName()
{
 wchar_t ExePath[MAX_PATH];
 GetModuleFileNameW(NULL,ExePath,sizeof(ExePath));
 return ExePath;
}
#else
string CPATH::GetExeName()
{
 char ExePath[MAX_PATH];
 GetModuleFileNameA(NULL,ExePath,sizeof(ExePath));
 return ExePath;
}
#endif

posted @ 2011-11-23 11:37  rookieeeeee  阅读(151)  评论(0编辑  收藏  举报