Re: ADO + CoInitialize in threads? Mystery...

From: Bas van Beek (bas-no_at_spam-please.nl)
Date: 02/24/05


Date: Thu, 24 Feb 2005 21:06:56 +0100

Kjell Rilbe wrote:

> OK. I kind of do both. :-) This is a DataModule with at least one
> TADOConnection and at least one TADODataSet dropped on the "form" at
> designtime. But the objects I'm using in the thread are created at
> runtime, within the thread.
>
> So then what? :-)

CoInitialize initializes the COM library for use by the calling thread.
Since you spawn new threads and create new ADO objects there, It would
be best to call it before creating the ADO objects.

Bas