?
Solved

How do I use OLE in Threads?

Posted on 1999-01-25
5
Medium Priority
?
148 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 1320 total points
ID: 1363216
Thank you for the points...  :-)))
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month14 days, 8 hours left to enroll

839 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