首页 > Windows开发 > 详细

Delphi Dll 动态调用例子(2)

时间:2016-10-07 13:44:25      阅读:180      评论:0      收藏:0      [点我收藏+]

http://zhidao.baidu.com/question/157196792.html

delphi动态调用DLL

写了个1.dll内容如下 library Project2; uses SysUtils, Classes; {$R *.res} function abc(x,y:Integer):Integer;stdcall; begin Result:=x+y; end; exports abc; end. 如何动态调用它呢。 比如想实现Edit3.Text:=IntToStr(abc(strtoint...展开
不对啊,调试通了,算不对。
青楼_男子_ | 浏览 6795 次  2010-06-03 16:15
2010-06-03 16:26 最佳答案
 
var
dll:Cardinal;
pp:function(x,y:integer):integer;
begin
dll:=LoadLibrary(PChar(‘xx.dll‘));
if dll<>0 then
begin
@pp:=GetProcAddress(dll, ‘abc‘);
if @pp<>nil then
Edit3.Text:=inttostr(pp(strtoint(Edit1.Text),strtoint(Edit2.text)));
FreeLibrary(dll);
end;
end;

Delphi Dll 动态调用例子(2)

原文:http://www.cnblogs.com/westsoft/p/5935725.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!