Subject Re: [IBO] To use TIB_ as parameter DLL, need to use ShareMem or SimpleShareMem in uses clause?
Author Geoff Worboys
AVs are always evil surprises. :-(

One thing to watch out for is the timing of your library
release. IBObjects does a number of things based on timer,
and the total release many Windows resources is not as
predictable as it could be. You may need to delay the
release of your DLL.

Note that you can also dynamically load and unload Delphi
runtime packages (see LoadPackage and UnloadPackage functions).
I do this in one my applications to provide a sort of plug-in
facility. (This application is still in Delphi6, I am in the
process of trying to upgrade, but it's a big application.)
Using this system I am sharing TIB_Connection and pretty much
everything other sort of component without problems. I do
the release in the application OnIdle processing by checking
reference counts on the dynamically loaded packages. (I
can't remember why I first did that, the code was written 15
years ago, but I do remember having trouble getting them to
release cleanly.)


Geoff Worboys
Telesis Computing Pty Ltd

hamacker sirhamacker@... [IBObjects] wrote:
> The reason for my question is that some times (its random),
> my application data crash with access viollation, but not
> inside DLL but outside after used, when my method was
> released by FreeLibrary. And it´s not clear if it´s my DLL,
> ´cause the error appear in any screen, but I investigate,
> if DLL not used, not crashed does not matter screen.

>  I create a method to use DLL as plugin to load dynamic and
> release after, I do an unit test and everthing is OK before
> exchange to production enviroment, but access viollation
> it´s evil surprise for me, so I will change TIB_Conn
> parameter to a colletion params WideString to create
> TIB_Connection inside DLL and not use by parameter.

> Thanks a lot.