日期:2014-05-16 浏览次数:20552 次
std::string SysPath(getenv("PATH"));
std::string::size_type pos = 0;
while (pos < mSearchPaths.size())
{
std::string::size_type newpos = mSearchPaths.find(';', pos);
std::string path;
if (newpos == std::string::npos) path = mSearchPaths.substr(pos);
else path = mSearchPaths.substr(pos, newpos-pos);
if (path.size() >= 1)
{
if (path[path.size()-1] != '\\') path += '\\';
AppPath.assign("PATH=");
AppPath.append(path).append(";").append(SysPath);
putenv(AppPath.c_str());
path.append("fbclient.dll");
mHandle = LoadLibrary(path.c_str());
if (mHandle != 0 || newpos == std::string::npos) break;
}
pos = newpos + 1;
}