Subject Re: [IBO] Problem with IBO
Author Jason Wharton
I recommend that you do not pass an object reference from the EXE to the DLL
because they are using potentially different code to process that object
instance. I would only do this if I was using run-time packages and could be
guaranteed that the instance would be handled by the same code module. This
is also how the ShareMem unit works. It puts the memory manager in a
run-time package (DLL) so that it is shared between EXE and DLL.

What I think you should do for now is have a TIB_Connection in the DLL and
instead of passing in the object reference just get the dbHandle out of the
connection in the EXE and put it into the dbHandleShared property of the
DLL's connection component.

I am assuming that the same thread from the EXE is going to be in the DLL
and that you are not spawning additional threads. If you are then this is a
totally different situation needing other actions to accommodate.

Jason Wharton
CPS - Mesa AZ

----- Original Message -----
From: <c46@...>
To: <>
Sent: Wednesday, April 04, 2001 1:08 AM
Subject: [IBO] Problem with IBO

> Hi Jason :
> Recently I use IBO to develop a system. In this system I have a main
> exe program that will load several sub-systems and each sub-system is
> a DLL. In order to reduce the connection times to IB, so I use a
> TIBODatabase in the main program and connect it to the database. When
> the main program loads the sub-system DLL, I pass the TIBODatabase to
> the DLL, and the DLL links its TIBOQueries to the TIBODatabase to
> access data from IB.
> After the DLL finishes its job, the DLL closes the TIBOqueries and
> sets TIBOQueries' IB_Connection property to nil, and returns to the
> main program , the main program then will free the DLL. But when the
> main program terminates, it will generate an access violation error,
> but this situation will not happen if I use BDE and/or IBX.
> I have tried to use IBO 3.6cd and 3.6D, both of the two versions
> will cause access violation, so can you help me to solve this
> problem? Because I want to use IBO to develop my system instead of
> BDE/IBX, thanks.
> Regards
> Gordon Li
> Your use of Yahoo! Groups is subject to