Super, danke! Das wars.
Für die Nachwelt: So gehts:
Delphi-Quellcode:
library Project2;
uses
SysUtils,
Classes,
Forms,
ExtCtrls;
{$R *.res}
type
THandler=Class
procedure TimerEventHandler(Sender: TObject);
end;
var
Timer: TTimer;
TestVar: integer;
Handler: THandler;
procedure THandler.TimerEventHandler(Sender: TObject);
begin
//mach was
Timer.Enabled:=false;
FreeAndNil(Timer);
TestVar:=1;
end;
function Test: integer; cdecl; export;
begin
result:=testvar;
end;
exports Test;
begin
TestVar:=0;
Handler:=THandler.Create;
Timer:=TTimer.Create(nil);
Timer.Interval:=1000;
Timer.OnTimer:=Handler.TimerEventHandler;
Timer.Enabled:=true;
end.