Subject Re: [IBO] IBO + DB + DLL
Author James N Hitz
Thanks

I will try out and let you know how it goes.... may take a while though since I am, in my estimation, the greenest IBO convert and I am just learning the ropes.

James N Hitz
----- Original Message -----
From: Geoff Worboys
To: IBObjects@yahoogroups.com
Sent: Thursday, April 27, 2006 12:42 AM
Subject: Re: [IBO] IBO + DB + DLL


> Question is, how can I allow a Connection stored in a DLL to
> be accessed by a Dataset(TIB_Query for example) in an EXE, or
> even another DLL... or vice versa.

When you go to the IBO website, into the FAQ section and
highlight (in the keyword list) "DLL Issues" you get:

- - - Start Quote - - -
When trying to share a connection DON'T try to share the
reference to the IB_Connection component. Give every DLL its
own TIB_Connection and simply share the connection handle
between them. Use the dbHandle property and assign the value
from it to the dbHandleShared property of the TIB_Connection
components in the DLL instances. Use whatever means you want
to pass the value, since it is just a simple integer.

One vital point: close the TIB_Connection in the EXE before
you terminate or destroy the DLL calls. Releasing the DLL
resources before you close the TIB_Connection can cause some
messy problems at termination!
(Jason Wharton)
- - - End Quote - - -


What I would add to this is... I have had good success using
a central (exe-based) connection shared amongst forms loaded
from dynamically loaded BPL packages (Borland's special DLLs).
But the forms have all been written as a derivation of a common
child class (the base class is part of the main application)
and so it all hangs together quite well.

If you really intend to use DLLs (rather than BPLs), or forms
which are truly independent of the main application, then I
suspect Jason's advice above still stands.

HTH

--
Geoff Worboys
Telesis Computing



___________________________________________________________________________
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

a.. Visit your group "IBObjects" on the web.

b.. To unsubscribe from this group, send an email to:
IBObjects-unsubscribe@yahoogroups.com

c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


------------------------------------------------------------------------------




[Non-text portions of this message have been removed]