MIDAS & DLLS...
Posted on 1998-10-06
I have created a dll with a form inside of it. Onclick of one of the buttons. I want to hit the DB using MIDAS controls. I know I have set the server up correctly, because i have tried to hit it on a normal form (not in a dll) and it works fine. In my dll, I drop a DCOMConnection, ClientDataSet, and DataSet on my form. I hooked my DCOMConnection to the server, the Client Dataset to the DCOMConnection and the DataSet to the ClientDataSet. I can Connect and Disconnect the DCOMConnection all day while I am in desgin mode. Once in run mode, I will call the dll and everything is fine, but as soon as I do anything that deals with connecting to the server, I get a "CoInitialize Has Not Been Called". What am I doing wrong?
Also, I first had these components on a datamodule inside of the dll and when I tried to access the db, I got a FFFFFFFFF error. My datamodule is in front of the form in the creation order (atleast it is first in the uses clause in the project source). Why would I get this error?
Any help appreciated...