unit Load_DLL_Test;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TfrmTest = class(TForm)
Memo1: TMemo;
bt32: TButton;
bt64: TButton;
procedure FormActivate(Sender: TObject);
procedure bt32Click(Sender: TObject);
procedure bt64Click(Sender: TObject);
private
public
{ Public-Deklarationen }
end;
var
frmTest: TfrmTest;
implementation
{$R *.dfm}
procedure TfrmTest.FormActivate(Sender: TObject);
begin
memo1.Lines.Clear;
memo1.Lines.Add('loadLibrary Test; Version vom 13.12.2019 ');
memo1.Lines.Add('ADDIPACK DLLs (32/64 bit) müssen in ');
memo1.Lines.Add('zwei Verzeichnissen ..\DLL32 bzw. ..\DLL64 liegen');
end;
procedure TfrmTest.bt32Click(Sender: TObject);
var
strName, strHome: string;
err : integer;
hndl : THandle;
begin
memo1.Lines.Add('');
hndl := 0;
strHome := ExtractFilePath(Application.ExeName);
strName := strHome + 'DLL32\ADDIDATA.DLL';
if FileExists(strName) then
memo1.Lines.Add('file ' + strName +' exists')
else
showMessage('
DLL 64 bit not found');
hndl := loadLibrary(PCHAR(strName));
err := GetLastError();
memo1.Lines.Add('32 bit ' + IntToStr(hndl) + ' last error ' + intToStr(err));
end;
procedure TfrmTest.bt64Click(Sender: TObject);
var
strName, strHome : string;
err : integer;
hndl : THandle;
begin
memo1.Lines.Add('');
hndl := 0;
strHome := ExtractFilePath(Application.ExeName);
strName := strHome + 'DLL64\ADDIDATA.DLL';
if FileExists(strName) then
memo1.Lines.Add('file ' + strName +' exists')
else
showMessage('
DLL 64 bit not found');
hndl := loadLibrary(PCHAR(strName));
err := GetLastError();
memo1.Lines.Add('64 bit ' + IntToStr(hndl) + ' last error ' + intToStr(err));
end;
end.