How do I use OLE in Threads?

I want to use OLE in Threads. To be more specific I use Delphis CreateComObject i my Threads, but every time I get the following error "test.exe raised exception class EOleSysError woth message 'CoInitialize has not been called'.....

Does anybody has an answer to help me out on this?

alpharvsAsked:
Who is Participating?
 
MadshiCommented:
Thank you for the points...  :-)))
0
 
EpsylonCommented:
Use CreateOleObject!
0
 
alpharvsAuthor Commented:
Hello Epsylon,
It didn't work, I get the same error.
0
 
MadshiCommented:
In the beginning of each thread do this:
  CoInitialize(nil);
At the end of each thread do this:
  CoUninitialize;

Regards, Madshi.
0
 
alpharvsAuthor Commented:
Hey It worked!

Thanks....

Hey Madshi - Could you post an answer?

Otherwise I can't give you any points.....


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.