Solved

B-I-G COM -problem

Posted on 2003-12-10
5
244 Views
Last Modified: 2010-04-05
Hi all,

My Project has a big problem - we are using COM Components (ADO, MSXML) in a multithreaded application. As soon as we run the application on a multithreaded processor, it crashes. The MSDN says that we have to do some kind of proxy in order to use the MSXML in a multithreaded app. Can anyone please give me some hints on how to do this? Have anyone used COM in a multithreaded app?

cheers,

henrik
0
Comment
Question by:henrikatwork
5 Comments
 
LVL 2

Expert Comment

by:Robn
ID: 9922713
How are you calling CoInitialize?
Have you tried this...
CoInitializeEx(nil, COINIT_MULTITHREADED);
0
 
LVL 6

Expert Comment

by:bpana
ID: 9922968
listening ...
0
 
LVL 12

Expert Comment

by:andrewjb
ID: 9926941
You need to CoInitialize in each thread.

And you can't just pass COM interface pointers between threads - they must be marshalled. Are you doing this?
0
 
LVL 1

Author Comment

by:henrikatwork
ID: 9928622
nope, how do I do the marshallening? I've never been doing that with Delphi, can you maybe give me an hint?

cheers,

henrik
0
 
LVL 12

Accepted Solution

by:
andrewjb earned 500 total points
ID: 9940999
Easiest way is to use CoMarshalInterThreadInterfaceInStream (what a function name!) which you can find documented in msdn, if nowhere else (just google!) Is that enough to get you going? The function is pretty obvious when you read it's description...
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

Title # Comments Views Activity
PDF library for Delphi 2 107
Delphi application Soap connection 5 96
Tviruailstringtree sort multi columns on header click 1 54
PHP preg_replace code convert to Delphi 14 36
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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…

867 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

18 Experts available now in Live!

Get 1:1 Help Now