Hi, I have a little problem with version 7 alfa svn at version 903 with Events, Firebird and Delphi XE, suppose that I register a event with name Event1 but the only way to fire the event is with the first character, in this case 'E' but if my second event is named Event2, two events a detected with IBEvenAlerter , with Lazarus I don't have this problem .
I need your help or any suggestion, thanks.
regards
Deplhi XE + Register Event with Firebird
Moderators: gto, EgonHugeist, olehs
Excuse me seawolf, maybe I didn't explain me correctly, Event1 and Event2 are the name of the events that I use for test case, maybe a bad example, sorry.
This is my procedure for register the name of my events:
with dmEvents.ZIBEventAlerter1 do
begin
// discard all registered events
UnregisterEvents;
// create new events ...
//moRegister contains lines with the names of each event name, in this case:
// 'Event1'
// 'Event2'
Events.Assign(moRegister.Lines);
// ... and register them
RegisterEvents;
end;
But the problem is that, the only way to fire the event in firebird is using the first character in this case 'E'
begin
post_event 'E'
end
But this causes both events in the application are identified, because both names start with 'E'.
I don't why, but same example with Lazarus works perfect.
Thanks
This is my procedure for register the name of my events:
with dmEvents.ZIBEventAlerter1 do
begin
// discard all registered events
UnregisterEvents;
// create new events ...
//moRegister contains lines with the names of each event name, in this case:
// 'Event1'
// 'Event2'
Events.Assign(moRegister.Lines);
// ... and register them
RegisterEvents;
end;
But the problem is that, the only way to fire the event in firebird is using the first character in this case 'E'
begin
post_event 'E'
end
But this causes both events in the application are identified, because both names start with 'E'.
I don't why, but same example with Lazarus works perfect.
Thanks
Hi, the problem is related to Unicode. At the moment I can't reproduce the problem but I suggest you open ZIBEventHandler.pas and change
function EBP(Index: integer): PAnsiChar;
begin
Inc(Index, (EventGroup * IB_MAX_EVENT_BLOCK));
if (Index > Parent.FEvents.Count) then
Result := nil
else
----> Result := PAnsiChar(AnsiString(Parent.FEvents[Index - 1]));
end;
function EBP(Index: integer): PAnsiChar;
begin
Inc(Index, (EventGroup * IB_MAX_EVENT_BLOCK));
if (Index > Parent.FEvents.Count) then
Result := nil
else
----> Result := PAnsiChar(AnsiString(Parent.FEvents[Index - 1]));
end;