Page 1 of 1
Deplhi XE + Register Event with Firebird
Posted: 25.07.2011, 21:32
by fredycc
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
Posted: 25.07.2011, 22:29
by seawolf
Do you use two ZIBEvent components?
ZIBEventAlerter1 -> Event1
ZIBEventAlerter2 -> Event2
And
ZIBEventAlerter1.Registered
ZIBEventAlerter2.Registered
Are set correctly?
Posted: 25.07.2011, 22:45
by fredycc
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
Posted: 28.07.2011, 21:53
by seawolf
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;
Posted: 02.08.2011, 19:08
by fredycc
Many thanks seawolf, works perfect
Regards