请问调用动态库里的接口函数有哪些方法?
一个动态库里可以有多个接口函数吗?如果是静态库怎么调用接口函数呢?
可以有多个接口函数吗?
怎么定义接口函数呢?难道非要这样定义与调用吗?
extern "C" _declspec(dllexport) int Test(CString IP,ROUTER *router)
调用
HINSTANCE hinstDLL=NULL;
hinstDLL=LoadLibrary("RouterFind.dll");
ROUTER router1;
if (hinstDLL)
{
typedef int(_cdecl *Connect)(CString IP,ROUTER *router);
Connect Proc;
Proc=(Connect)GetProcAddress(hinstDLL,"RouterFind"); Proc(m_ip,&router1);
FreeLibrary(hinstDLL);
}
else
{
MessageBox("DLL not found!","Test",MB_OK);
}
请大侠指点!
一个动态库里可以有多个接口函数吗?如果是静态库怎么调用接口函数呢?
可以有多个接口函数吗?
怎么定义接口函数呢?难道非要这样定义与调用吗?
extern "C" _declspec(dllexport) int Test(CString IP,ROUTER *router)
调用
HINSTANCE hinstDLL=NULL;
hinstDLL=LoadLibrary("RouterFind.dll");
ROUTER router1;
if (hinstDLL)
{
typedef int(_cdecl *Connect)(CString IP,ROUTER *router);
Connect Proc;
Proc=(Connect)GetProcAddress(hinstDLL,"RouterFind"); Proc(m_ip,&router1);
FreeLibrary(hinstDLL);
}
else
{
MessageBox("DLL not found!","Test",MB_OK);
}
请大侠指点!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货