Subject | Re: [IBO] Re: TIB_Events |
---|---|
Author | Robert martin |
Post date | 2006-07-25T20:55:09Z |
Hi
fAvailable is a property variable of the company class, when .Available
is toggled the Database.Connected property is also toggled. The
registerevents / Unregisterevents code takes place while .connected is
set to true.
As a side question, does disconnecting from the database automatically
unregister the events?
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
radevojvodic wrote:
fAvailable is a property variable of the company class, when .Available
is toggled the Database.Connected property is also toggled. The
registerevents / Unregisterevents code takes place while .connected is
set to true.
As a side question, does disconnecting from the database automatically
unregister the events?
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
radevojvodic wrote:
> what is fAvailable variable. If it means that connection is not
> available then unregistering events could not be performed.
>
>
>
> --- In IBObjects@yahoogroups.com, Robert martin <rob@...> wrote:
>
>> Hi
>>
>> I have setup a TIB_Events for each 'Company' managed by our
>> application. It is working great, in that it triggers correctly and
>> runs just fine. However (most times) when I close the app I get a
>> GDS32.dll error. It seems to be triggering when I disconnect from the
>> database, although I cannot be 100% sure. Can anybody offer some
>> suggestions.
>>
>> TIA
>>
>>
>> My code follows.
>>
>>
>> In the TCompany class it is setup like this...
>>
>>
>> fIb_Events := TIB_Events.Create(fSession);
>> fIb_Events.IB_Connection := DataBase;
>> fIb_Events.Events.Clear;
>> fIb_Events.Events.Add('ProcessEvent_Changed');
>> fIb_Events.OnEventAlert := TriggerEvent;
>>
>> When the Database is connected the following code runs...
>>
>> if (fAvailable = True) then begin
>> if (fIb_Events.Registered = False) then begin
>> fIb_Events.RegisterEvents;
>> end;
>> end;
>>
>> And when it is disconnected (It sometimes is connected and disconnected
>> multiple times during the classes life) ...
>>
>> if (fAvailable = False) then begin
>> if (fIb_Events.Registered = True) then begin
>> fIb_Events.UnregisterEvents;
>> end;
>> end;
>>
>> In the TCompany destructor ...
>>
>>
>> fIb_Events.OnEventAlert := Nil;
>>
>> if (DataBase.Connected = True) then begin
>> if (fIb_Events.Registered = True) then begin
>> fIb_Events.UnregisterEvents;
>> end;
>> end;
>>
>> fIb_Events.IB_Connection := Nil;
>> fIb_Events.Free;
>>
>> ....
>>
>> DataBase.Connected := False;
>> DataBase.Free;
>>
>>
>> --
>> Rob Martin
>> Software Engineer
>>
>> phone +64 03 377 0495
>> fax +64 03 377 0496
>> web www.chreos.com
>>
>> Wild Software Ltd
>>
>>
>
>
>
>
>
>
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>