陈田拆车件商家电话:VC调用Delphi写的dll的问题

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/15 06:23:57
dll中的函数为
drawcard(bmp:bitmap;num:integer)

前面我这样写的
typedef int* (*GETDT)(UINT,int);//*******
GETDT GetDT;

FARPROC lpfn = NULL;
HINSTANCE hinst = NULL;
hinst = LoadLibrary("gbhcards.dll");
if(hinst == NULL)
{
AfxMessageBox("不能加载动态连接库!");
return;
}
lpfn = GetProcAddress(hinst,"drawcard");
if(lpfn == NULL)
{
AfxMessageBox("不能加载所需要的函数!");
return;
}
else
{
GetDT = (GETDT) lpfn;
GetDT(IDC_STATIC_BMP,15);//******
FreeLibrary(hinst);
}