在一个程序中,怎样调用一个dll文件?
解决方案 »
- 几个函数问题
- 如何让TStringGrid里的数据默认上下左右都居中 !~~ 在线等
- 请问哪里可以下载到新版的winzip
- Delphi版怎么没版主说一下强制结贴的事???
- 如何彻底删除表中记录!(在线给分!)
- 求救:为什么程序会停止响应????????????????????????????????
- 数据保存问题
- 在win2000做出来的东西,到了win98下各个组件的大小都变了,怪哉!?
- cobi(小新国际)兄,请再帮忙看看这个帖子:http://www.csdn.net/expert/TopicView.asp?id=287792,有另一些问题没有搞清楚。
- 请问在连接SQL 时如何越过登路对话框?
- 拿位大虾有mcisendstring的详细字符串资料,发上来共享一下好吗???--急
- 免费 ACM 控件,音频压缩,格式转换。制作网络语音传输的好东西。-----ACMIO
放在
implementation之前
function GetValue:Integer;Stdcall;external 'ShareDate.dll';然后就可以直接使用了
LoadLibrary、FreeLibrary、GetProcAddress
//////////////////////动态加载DLL,最小化窗口
type minwin=procedure(myform:tform);stdcall;
var
handle1:thandle;
pfunc:tfarproc;
begin
handle1:=loadlibrary('mass.dll');
if handle1=0 then
begin
showmessage('Not Found Mass.dll');
exit;
end;
pfunc:=getprocaddress(handle1,'minwindow'); ///minwindow为mass.dll中的函数。
if pfunc<>nil then
minwin(pfunc)(self)
else
showmessage('Not Found Function');
freelibrary(handle1);
end;