Dll文件调用问题

kfb007 2005-03-27 10:01:50
请教大虾:
我将Dll文件放在程序所在目录的一个子目录下,而不在系统目录或程序所在主目录下,用delphi如何调用这些Dll文件的函数?同时这些Dll文件也需要互相调用对方的函数。
...全文
57 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
ju1 2005-03-27
  • 打赏
  • 举报
回复
type TMatchSearcher= function (wanting,founding:PChar):boolean; stdcall;
var
s1,s2,dllpath:string;
i:Longint;
hInstDLL:THandle;
pms1:TMatchSearcher ;
begin
s1:=trim(edit2.Text );
listbox2.Items.Clear ;
hasfenxip:=false;

dllpath:=ExtractFilePath(Application.ExeName )+'\新建文件夹\tongpeidll.dll';
hInstDLL := LoadLibrary(PChar(dllpath) );
if(hInstDLL =0) then exit;
@pms1 :=GetProcAddress(hInstDLL ,'MatchSearcher');
if (@pms1=nil) then exit;

for i:=0 to Memo1.Lines.Count -1 do
begin
s2:=Memo1.Lines.Strings[i];
if pms1(PChar(s1),PChar(s2)) then
// if MatchSearcher(PChar(s1),PChar(s2)) then
begin
listbox2.Items.Add(s2);
end;
end;
if (hInstDLL<>0) then FreeLibrary(hInstDLL);
end;

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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