Solved

Conversion from SingleThread to MultiThread cause CoCreateInstance to fail

Posted on 2002-06-05
5
791 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

751 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