unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TSummenFunktion =
function(zahl1, zahl2: integer): integer;
function addieren(zahl1, zahl2: integer): integer;
type
TForm1 =
class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function addieren(zahl1, zahl2: integer): integer;
var SummenFunktion: TSummenFunktion;
Handle: THandle;
begin
Handle := LoadLibrary(PChar('
rechnen.dll'));
if Handle <> 0
then begin
@SummenFunktion := GetProcAddress(
Handle, '
addieren');
if @SummenFunktion <>
nil then begin
result := addieren(12,3);
end;
FreeLibrary(
Handle);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(IntToStr(addieren(12,3)));
end;
end.