I have got an exe with a remote data data module which is going to provide data to various forms which are contained in various dlls - which in turn get called by a main application.
Now some of the dlls - due to various reason need to be converted to activeX dlls- which in turn are loaded as required by the main application by calling a normal dll which in turn initialize the ActiveX dll.
Now When I load the ActiveX dll, everything is OK, the remote data server
starts up, the forms in the activex dlls are show to the user and so on. But when I shut down the main application everything goes haywire, the activeX dll refuses to be unloaded, and I get too many exceptions- lots and lots of access violation.The application and most of the thime windows simply hang. When I try to close the remote server, I get the warning that there are still objects connected to the server- even though I have explicitely destory the activeX dll.
I am using Windows 98 Second Edition, Delphi 5 enterprise Edition and I am connecting to a Access 2000 Database using the ADO Components. In addition I am using InfoPower 2000 components. I am using code like this:
The name of the interface in the automatiom Object is IMBCif
In the activeX dll we have code like this:
the datamodule is dmCIF
The Form is FrmCIf
In the ActiveX dll I have got code like this:
if not assigned(dmCIF1) then
dmCIF1 := DMCIF.create(nil);
dcomConnection.connected := true;
open various ClientDataSet;
if not assigned(FrmCIF1) then
if assigned(FrmCIF1) then
if assigned(dmCIF1) then
close various ClientDataSet;
dcomConnection.connected := false;
Now I import the type library in the dll(LoadCIF.dll) and write sometning like this;
IMiCIF : IMBCif;
if IMiCIF <> nil then
IMicif := CoMiCIF.create;
if imicif <> nil then
MyMain app I call the dll like this
on click event of a button;
if not dllLoaded then
DllHandle := LoadLibrary('LoadCIf.dll');
@ShowForm := getProcAddress(DllHandle,'
@closForms := getProcAddress(DllHandle,'CloseForms');
on the destory event of the form.
Can Anybody please help, It is driving me crazy.