Delphi调用VC++的DLL?

Mars 2000-06-23 08:19:00
如果VC++的DLL中有如下声明:
int function test(short *mydata,short count)
{。。。}
其中mydata和count都是要反回值的形参,用Delphi应该如何掉用!

...全文
147 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
jll 2000-06-24
  • 打赏
  • 举报
回复
function test(mydata:point;var count:integer):integer;stdcall external 'yourname.dll' name 'test';
meijg 2000-06-24
  • 打赏
  • 举报
回复
function test(mydata:point,count:integer):Integer;stdcall external 'yourname.dll' name 'test';
H999 2000-06-24
  • 打赏
  • 举报
回复
VC++ code:
extern "C" int PASCAL EXPORT test(short *mydata,short count){
return (*mydata * count);
}

EXPORTS
test;
VC生成csdn.dll.
delphi调用,下面code已经调试成功。
Good luck!

delphi code:
procedure Tmainfm.Button1Click(Sender: TObject);
var P:function( mydata : pointer; count : integer ):integer; stdcall;
hlib : THANDLE;
a : integer;
begin
a := 10;
hLib:=LoadLibrary(PChar('csdn.dll'));
P:=GetProcAddress(hLib,'test');
edit1.text := inttostr( P(@a,10) );
end;
kxy 2000-06-23
  • 打赏
  • 举报
回复
int function test(short *mydata,short count)
count如何返回值?

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧