动态加载dll

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);

原文地址:https://www.cnblogs.com/lpxblog/p/5801562.html