Solved

Conversion from SingleThread to MultiThread cause CoCreateInstance to fail

Posted on 2002-06-05
5
781 Views
Last Modified: 2012-06-21
I convert my com Out-Proc project from CComSingleThreadModel to be CComMultiThreadModel.
(ThreadingModel = Free).
This out-proc calls an in-proc project (multiThreaded as well), this in-proc tries to CoCreateInstance of ShellLink interface.
Since the conversion the CoCreateInstance of ShellLink interface failed, the error I recieve is -2147467262 ("no such interface supported").
(Just for testing, I make my out-proc to be a SingleThreaded again and it worked fine).
What should I do to make it work in MultiThreaded as well ?
0
Comment
Question by:Sharonz
5 Comments
 
LVL 3

Expert Comment

by:jimbucci
ID: 7107224
Try setting ThreadingModel = Both
0
 

Author Comment

by:Sharonz
ID: 7107440
Thanks for your answer.
I solved it already, but in a different way.
I found out that current versions of shell32 do not contain marshaling information for shell interfaces such as IShellLink. Without the marshaling information, COM
cannot make method calls in shell interfaces in a multithreaded apartment.
I solved it by creating a new In-Proc project SingleThreadModel that create the ShellLink for my Out-Proc project (the MultiThreaded one).
0
 
LVL 3

Expert Comment

by:jimbucci
ID: 7107496
excellent.
0
 
LVL 11

Expert Comment

by:griessh
ID: 7261486
Dear Sharonz

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to

     "refund the points and PAQ at 0 points"

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 7332884
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **
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
c++ mixing int and strings in multi array 8 71
Visual c++ and text files 7 60
Template syntax for variable length arrays 9 71
c++ syntax question 9 44
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

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

21 Experts available now in Live!

Get 1:1 Help Now