Solved

Conversion from SingleThread to MultiThread cause CoCreateInstance to fail

Posted on 2002-06-05
5
795 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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 how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

615 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