?? testdll.pas
字號:
unit TestDLL;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, DB, ExtCtrls, DBTables;
type
TShowForm = function: Bool; StdCall;
EDLLLoadError = class(Exception);
TfrmCallDLL = class(TForm)
Database1: TDatabase;
btnCallDLL: TButton;
btnClose: TButton;
procedure btnCallDLLClick(Sender: TObject);
procedure btnCloseClick(Sender: TObject);
end;
var
frmCallDLL: TfrmCallDLL;
implementation
{$R *.DFM}
procedure TfrmCallDLL.btnCallDLLClick(Sender: TObject);
var
LibHandle: THandle;
ShowForm: TShowForm;
begin
LibHandle := LoadLibrary('RptDLL.DLL');
try
if LibHandle = HINSTANCE_ERROR then
raise EDLLLoadError.Create('Unable to Load DLL');
@ShowForm := GetProcAddress(LibHandle, 'ShowForm');
if not (@ShowForm = nil) then
ShowForm;
finally
FreeLibrary(LibHandle);
end;
end;
procedure TfrmCallDLL.btnCloseClick(Sender: TObject);
begin
Close;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -