std::string GetFilePath()
{
char
exepath[MAX_PATH];
std::string
strdir,tmpdir;
memset(exepath,0,MAX_PATH);
GetModuleFileName(NULL,exepath,MAX_PATH);
tmpdir=exepath;
strdir=tmpdir.substr(0,tmpdir.rfind(‘\\‘));
strdir
+= "\\";
return strdir;
}
原文地址:http://www.cnblogs.com/dongzi--C/p/3713470.html