Suicide is imminent!!!!

Marc Palmer <> wrote:

> I have created a DLL in Delphi that provides database access via the
> standard Delphi TTable object. I have functions exported like
> GetFirstUser, GetNextUser, GetPrevUser. I also have an Init and CleanUp
> function.

> The Init function creates the TDatabase, TTable and TField objects but
> only once, so that they are no created again if Init is called
> repeatedly. The CleanUp function frees the Fields, Table, and Database -
> again, only once, when the DLL is no longer in use.

> The problem is this:

> When I use the DLL in another app (be it a C++/Delphi app), and only
> call Init and CleanUp, everything is fine. That is, until I run the
> program a second time and BANG! GPFs in any number of different DLLS,
> including the Kernel, ILD01.DLL, COMMDLG.DLL etc.


I had a similar problem. What finally fixed it is initializing the BDE
from C++ before loading the DLL.