Problem Using Ole Automation within a tthread !

"O.H" <maggoo...@hotmail.com> skrev i melding
news:93qbnt$fe4$1@news1.skynet.be...

Quote
> I'm trying to use ole automation within a TThread using a code like

> var
>  ooword:variant;
> begin
> ooword:-createoleobject('word.application');
> ooword.visible:=true;
> end;

> but all I get is a ole automation error.

> This code works perfectly fine when it's not within a tthread !

> Is there any reason why ole automation should not work within threads ?

May be you'll have to call

  CoInitializeEx (MultiThreaded);

...but if you want to read more about this, see this article:

http://www.techvanguards.com/com/concepts/multithreading.htm

--
Bjoerge Saether
Consultant / Developer
http://www.itte.no
Asker, Norway
bjorgeremovet...@itte.no (remove the obvious)