char curpath[128] = {0};
string::size_type pos = str.find_last_of("\\");
if(pos != string::npos)
{
str = str.substr(0,pos)+"\\StandardSDK\\pis";
GetModuleFileNameA(NULL,curpath,sizeof(curpath)); //获取应用程序的路径
// 去除最后的应用程序名xxx.exe
string str(curpath);string::size_type pos = str.find_last_of("\\");
if(pos != string::npos)
{
str = str.substr(0,pos)+"\\StandardSDK\\pis";
}
//设置dll的绝对路径
bool flag = SetDllDirectoryA(str.c_str()); //设置dll的绝对路径
//加载dll
m_hLib = ::LoadLibraryA("XXX.dll");
if(m_hLib != NULL)
{
}