#include <atlbase.h>
#undef CreateDialog
//获取dll路径
string getProgramPath()
{
char filePath[MAX_PATH];
GetModuleFileNameA(_AtlBaseModule.GetModuleInstance(), filePath, MAX_PATH);
std::string strDllPath(filePath);
strDllPath = strDllPath.substr(0, strDllPath.find_last_of("\\") + 1);
return strDllPath;
}
//读取存放在dll目录下的dlx路径,并修改theDlxFileName
string dllPath = getProgramPath();
theDlxFileName = dllPath.append("xxxx.dlx").c_str();
//获取NXBIN目录路径
string Get_NXBIN_Path()
{
string Path;
char szModule[1024] = { 0 };
GetModuleFileNameA(NULL, szModule, sizeof(szModule) / sizeof(szModule[0]));
Path = szModule;
Path.erase(Path.find_last_of(L'\\'));
return Path;
}