VC调用Delphi写的Dll碰到一点小问题!!

sunjun240 2005-03-02 12:44:59
Delphi中写的Dll,其接口函数格式
SendReal (channel,flag,date1,time1,value1,value2,value3,value4,value5,value6,value7:Double):single;

VC中如何调用该dll的接口函数!
//***********************************
typedef float(_cdecl *Connect)(double i);
HINSTANCE hinstDLL=NULL;
hinstDLL=LoadLibrary("dllname.dll");
if (hinstDLL)
{
Connect Proc;
Proc = (Connect)GetProcAddress (hinstDLL,"SendReal");
float iValue = Proc(1,0,20050302,124701,1,2,3,4,5,6,7);//出错
FreeLibrary(hinstDLL);

}
error:
error C2197: 'float (__cdecl *)(double)' : too many actual parameters
...全文
44 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
tankbattle 2005-03-02
还有调用约定_stdcall(上面回复少了下划线)和_cdecl的区别
回复
tankbattle 2005-03-02
typedef float(stdcall *Connect)(double channel,double flag,double date1,double time1,double value1,double value2,double value3,double value4,double value5,double value6,double value7);
参数总还是要一样的吧
回复
sunjun240 2005-03-02
typedef float(stdcall *Connect)(double channel,double flag,double date1,double time1,double value1,double value2,double value3,double value4,double value5,double value6,double value7);
后,编译通过。。。
我再看看是否调用成功.......
回复
相关推荐
发帖
进程/线程/DLL
创建于2007-09-28

1.5w+

社区成员

VC/MFC 进程/线程/DLL
申请成为版主
帖子事件
创建了帖子
2005-03-02 12:44
社区公告
暂无公告