Windows fails to create TRichEdit window handle

Windows fails to create the window handle of a TRichEdit control if
setting the ComObj.CoInitFlags to COINIT_MULTITHREADED before calling
Application.Initialize function.

I created a new Delphi 4 application project.
I placed a TRichEdit control in the application's main form.

If you run the application from the IDE, you won't get any errors, but
if you set the ComObj.CoInitFlags to COINIT_MULTITHREADED, windows will
fail when attempting to create the window handle (CreateWindowEx, in

I have to set this COINIT_MULTITHREADED flags because I am using a COM
object to output application's debug information to a program.

Same thing happens in Delphi 4, C++ Builder 4 and Delphi 5.

Has anyone ever had experimented this problem before?

Please let me know, thanks!

Sent via
Before you buy.