Board index » delphi » Creating and Free Components within a COM object

Creating and Free Components within a COM object

I am writing a COM object which will use an ADOConnection. I guess I create
it in the Initialize and destroy it in the Destroy - Correct? Is there
anything I can use an owner to help it free itself if something goes wrong
or do I have to pass nil?
Has anyone got any sample DB (BDE or ADO) based COM component code?
 

Re:Creating and Free Components within a COM object


nil is OK. Destroy will likely be called. If you are worried about this,
then dynamically create and free ADOConnections on a per-method level.

--
have fun
Binh Ly
http://www.techvanguards.com

Quote
"Greg Nixon" <greg.ni...@infinity.co.nz> wrote in message

news:3b4e842e_2@dnews...
Quote
> I am writing a COM object which will use an ADOConnection. I guess I
create
> it in the Initialize and destroy it in the Destroy - Correct? Is there
> anything I can use an owner to help it free itself if something goes wrong
> or do I have to pass nil?
> Has anyone got any sample DB (BDE or ADO) based COM component code?

Other Threads