您的位置:首页 > 其它

动态加载dll

2016-08-24 09:14 169 查看
extern "C" MMUPDATENOTIFY_IMPEXP bool _cdecl NotifyThrift(char* chThriftIp, char* chPor)

HINSTANCE hInst;
CString strPath = _T("E:\\XXX\\MmUpdateNotify.dll");
hInst = LoadLibrary(strPath);
if(hInst != NULL)
{
typedef bool(*Proc)(char* strIp, char* strPort);
Proc p = (Proc)GetProcAddress(hInst, "NotifyThrift");
if(!p)
{
AfxMessageBox(_T("获取地址失败"));
return;
}
bool bVal = p("127.0.0.1", "9090");
}

FreeLibrary(hInst);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: