Deplhi XE + Register Event with Firebird

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
fredycc
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: 18.01.2010, 16:48

Deplhi XE + Register Event with Firebird

Post 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 :roll: .

I need your help or any suggestion, thanks.

regards
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

Do you use two ZIBEvent components?

ZIBEventAlerter1 -> Event1
ZIBEventAlerter2 -> Event2

And
ZIBEventAlerter1.Registered
ZIBEventAlerter2.Registered

Are set correctly?
fredycc
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: 18.01.2010, 16:48

Post 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
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post 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;
fredycc
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: 18.01.2010, 16:48

Post by fredycc »

Many thanks seawolf, works perfect :)

Regards
Locked