Re: Error in a console program with COM Object

Posted by Van Smith on November 20, 2004

In Reply to: Error in a console program with COM Object posted by LM Series on September 16, 2004

: i made a console program, to put in a web page, that has a com objest to comunicate with a database, but, at run time, there's this error:"EOleSysError: CoInitialize hasn't been colled".
: I'm sorry form my English.
: Please Help Me.
: thanks a lot (grazie del lotto)

This is a generalized solution.

1. place "ActiveX" in uses clause.

2. At the beginning of code for program/thread:
CoInitializeEx(NIL, COINIT_APARTMENTTHREADED);

3. At the end of code for program/thread:
CoUninitialize;


[ DelphiLand FAQ ]