编译不通过,大家帮帮忙看下
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
private
{ Private declarations }
public
function LoadDlldb(i:integer):Boolean;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function TForm1.LoadDlldb(i:integer):Boolean;
//调用初始化数据库DLL
//i:0:用户
//i:1:定时器
var
dllhandle : THandle; //句柄
Show_TTFrmSiteAdd:function():Boolean;stdcall; //用户触发
TimerShow_TTFrmSiteAdd:function():Boolean;stdcall; //定时器触发
begin
Result:=False;
if not FileExists('SiteAddDel.dll') then
begin
showmessage('缺少SiteAddDel.dll文件,无法完成此操作.');
exit;
end;
dllhandle := LoadLibrary(pchar('SiteAddDel.dll'));
try
try
case i of
0:begin
@Show_TTFrmSiteAdd := GetProcAddress(dllhandle,'Show_TTFrmSiteAdd');
Result:=Show_TTFrmSiteAdd();
end;
1:begin
@TimerShow_TTFrmSiteAdd := GetProcAddress(dllhandle,'TimerShow_TTFrmSiteAdd');
Result:=TimerShow_TTFrmSiteAdd();
end;
end;
except
end;
finally
//FreeLibrary(dllhandle);
end;
end;
end.