如何调用Dll中类的成员?
各位前辈:
VC中如何动态调用Dll中类的成员?普通函数可以这样:
////////////////////////////////////////////////
HINSTANCE hDll = NULL;
hDll = ::LoadLibrary("My.dll");
if(hDll == NULL)
{
AfxMessageBox("Load library failed!");
return;
}
int (*pFun)(char *pIDNo);
pFun = (int (*)(char *pIDNo)::GetProcAddress(hDll, "Test");
if(pFun == NULL)
{
::FreeLibrary(hDll);
AfxMessageBox("Load function failed!");
return;
}
int rev = pFun("IDNo");
CString str;
str.Format("Return : %d",rev);
MessageBox(str);
::FreeLibrary(hDll);
///////////////////////////////////////////////////////////
但类呢?