Solved

How do I use OLE in Threads?

Posted on 1999-01-25
5
134 Views
Last Modified: 2010-04-06
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?

0
Comment
Question by:alpharvs
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 1363212
Use CreateOleObject!
0
 

Author Comment

by:alpharvs
ID: 1363213
Hello Epsylon,
It didn't work, I get the same error.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1363214
In the beginning of each thread do this:
  CoInitialize(nil);
At the end of each thread do this:
  CoUninitialize;

Regards, Madshi.
0
 

Author Comment

by:alpharvs
ID: 1363215
Hey It worked!

Thanks....

Hey Madshi - Could you post an answer?

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


0
 
LVL 20

Accepted Solution

by:
Madshi earned 330 total points
ID: 1363216
Thank you for the points...  :-)))
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now