Subject Re: [IBO] Problem with IBO
Author Geoff Worboys
> I'm using dynamic linking for my DLL's, so the EXE file
> doesn't care what happens in DLL's. Each DLL contains TForm
> with IBO components. For example one DLL is for creating
> payments, another is for currency conversions (it's
> remote banking software).

You can still do this, simply by loading the DLL and calling
GetProcAddress for a known name procedure in the DLL. This allows you
to keep this isolated but still permit the EXE to load and instantiate
the class. I used to define the library and procedure names via a
text field read from the database (could use an ini file if you like)
allowing additional procedures and forms to be added without

I would generally create a single exported function in the DLL that
would do the creation of the form, and that was the function called by
the EXE - its only parameters begin for the mainform reference (to be
used as owner) and reference to a structure containing other useful

I setup a TList of special library access records to keep track of
what DLLs I had openned and me to release them when no longer
required. When a DLL form was created it would increment a reference
counter in the associated TList entry, when destroyed it would
decrement the reference counter.

> Currently I'm creating new connection within DLL file, but it
> takes time.

And resources!

> Now I found out the possibility to share my single connection.
> Before converting my application to connection sharing, I
> wonder what pitfalls there may be (transactions, multiple
> users working with program, etc.)

Well I would share the entire connection (since we are not
multi-threading) not just the handle - since there may be signifcant
resource advantages depending on how you use your connection. I
almost always have a transaction on the form itself, since I almost
always consider a form to represent a unit of work.

The old version of the program that used the approach I describe, has
been used every day for over 9 months by about 30 users without any
dramas relating to DLL implementation. The new version of the program
is moving away from DLLs and runtime libraries (I used both) and
almost all forms come from the database itself.

Geoff Worboys
Telesis Computing