Not exactly,
procedure EventCallback(P: Pointer; Length: Short; Updated: PByte); cdecl;
var e:TFBEvents;
begin
if (Assigned(P) and Assigned(Updated)) then begin
e:=TFBEvents(p);
try
e.FSO.Enter;
e.EventsReceived := true;
if e.ResultBuffer<>nil then
Move(Updated[0], e.ResultBuffer[0], Length);
finally
e.FSO.Leave;
end;
end;
end;
And event is firing on timer:
procedure TFBEvents.OnTimerTimer(Sender: TObject);
var
i: Integer;
bt : TBytes;
FCancelAlerts : Boolean;
begin
FSO.Enter;
try
FDatabase.GDSLibrary.isc_event_counts(@FStatus, EventBufferLen,
EventBuffer, ResultBuffer);
if Assigned(FOnEventAlert) and (not FirstTime) then begin
FCancelAlerts := false;
for i := 0 to FEvents.Count - 1 do begin
if (FStatus[i] <> 0) then begin
bt := FEvents[i];
FOnEventAlert(self, TEncoding.ANSI.GetString(bt, 0,
Length(bt) - 1), FStatus[i], FCancelAlerts)
end;
end;
end;
FirstTime := false;
finally
FSO.Leave;
end;
SQueEvents;
end;
Timer is in this example sets to 20ms.
And one of Event causes event unregistration.
Slavek
One callback always happens after canceling events - it was API
behavior since IB times. It's supposed you are closing your events'
listener on that callback.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel