Need Help from BDE API Gurus

Sorry to burden everyone again with the latest update of my DLL problems,
but I'm desperate to sort out the problem. Any help would be greatly

The story so far ...

* I get an error message saying "External Exception 80000004"
* It happens when a particular combination of events occurs - when I try to
open a table with more than 15 fields, after having called
TTable.IndexDefs.Update on two occasions earlier in the program. I have
tested it extensively and it requires this exact combination of events to
occur - 15 fields or less and it is OK, Update called only once and it is
* It seems to only happen in a DLL.
* It won't happen when running the DLL inside the IDE.
* I have gotten into the VCL source code and found out that the exception
happens within the BDE function DbiOpenTable. The arguments passed to this
function seem to be OK.
* I have also found that the problem goes away when one function call is
commented out of TIndexDefs.Update. This function is dbiGetLdObj (gets a
language driver object).
* The pointer that is set by this function seems to be filled with garbage,
if I am correct in assuming that it can be cast to point to a LDDesc object.

Some questions which I hope someone can answer:
* Someone who replied to my previous message said they had heard that the
BDE has some problems in DLLs. Can anyone confirm or deny this?
* What could be going wrong with dbiGetLdObj?
* How could this be affecting dbiOpenTable later in the program?
* Is there any way of working around this problem in the VCL?


Neil McCrossin
Brisbane, Australia