📄 main.pas
字号:
unit Main;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TMainForm = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainForm: TMainForm;
// You need to let the application know where to find that functions.
// Remember to always use the dll extension or Delphi won't find the dll.
function MyShowMessage(Text: PChar): Integer; far; external 'AceDll.dll';
function RunBiolifeReport: Integer; far; external 'AceDll.dll';
implementation
{$R *.DFM}
procedure TMainForm.Button1Click(Sender: TObject);
begin
MyShowMessage('It works!');
end;
procedure TMainForm.Button2Click(Sender: TObject);
begin
RunBioLifeReport;
end;
type
TMyReport = function: Integer;
procedure TMainForm.Button3Click(Sender: TObject);
var
GetReport: TMyReport;
Handle: THandle;
begin
Handle := LoadLibrary('AceDll.dll');
if Handle <> 0 then
begin
// if the case is not the same as its defined then the
// functio will not be found.
@GetReport := GetProcAddress(Handle, 'RunBiolifeReport');
if @GetReport <> nil then GetReport;
FreeLibrary(Handle);
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -