昨天拿到一个dll,要求用动态链接
但是一直都是用静态的动态不会用
这个是他在Delphi中的申明
procedure CreateInstance(var hdl: Integer); stdcall; external 'mztransfer.dll';我是这样在MFC中调用*.h
typedef void (*CREAINSTANCE)(int _Hdl);*.cpp
HINSTANCE hmod;
hmod = ::LoadLibrary(_T("*****.dll"));
if (NULL == hmod)
{
AfxMessageBox(_T("加载Dll失败!"));
return ;
}CREAINSTANCE CreaInstance = (CREAINSTANCE)GetProcAddress(hmod, "CreateInstance");
if (!CreaInstance)
{
AfxMessageBox(_T("获取函数地址失败!"));
return ;
}int count = 0;
CreaInstance(count);但是我在执行最后一步的时候出错了,请问是什么地方出了问题