library ListDLL;
uses Classes;
var
sl: TStringlist;
SaveExit: Pointer;
procedure LibExit;
begin
sl.free;
ExitProc := SaveExit;
end;
procedure fill;
begin
sl := TStringlist.create;
sl.add('Test');
sl.add('Versuch');
sl.add('Delphi');
end;
function GetList: TStringlist;
begin
result := sl;
end;
exports GetList;
begin
fill;
SaveExit := ExitProc;
ExitProc := @LibExit;
end.
//------------- Audfruf im Programm ---------------
function GetList: TStringlist; external 'ListDLL.dll';
var
sl: TStringlist;
procedure TForm1.Button7Click(Sender: TObject);
begin
sl := GetList;
showmessage(sl[1]);
end;