//示例
unit YYGL_dllfun;
interface
//申明部分
procedure Qry_SickInfo(Aconnstr,ACompany_Name:string;AZyNo:string='');
//病员信息查询
procedure Qry_BedUsed(Aconnstr,ACompany_Name:string);
//床位使用情况查询
procedure Qry_Zy_pay(Aconnstr,ACompany_Name:string);
//住院缴费查询
implementation
//实现部分
procedure Qry_SickInfo(Aconnstr,ACompany_Name:string;AZyNo:string='');external 'ZyQry.dll';
procedure Qry_BedUsed(Aconnstr,ACompany_Name:string);external 'ZyQry.dll';
procedure Qry_Zy_pay(Aconnstr,ACompany_Name:string);external 'ZyQry.dll';
把此单元放到一个delphi能搜索到的路径,如%delphi%/lib里,或把此单元的路径回到
delphi的搜索路径里。这样多个工程引用时就不用增加这个单元到工程了,可以直接uses这个单元就行了
调用:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
uses YYGL_dllfun;//引用 包含dll函数的公共单元
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Qry_SickInfo(connstr,Company_Name,zyNo);
end;
end.