CoCreateInstanceEx returns "Access is Denied"

Posted on 1999-07-21
Medium Priority
Last Modified: 2010-09-02
I"ve installed Msdn basic example for DCOM, simple.
and tried to run it.
when the server was on the same machine there was no problem. but when the server was on a different machine i got an error code that meant ( through format message ) "Access is Denied".
this is the calling code
  hr = CoCreateInstanceEx(CLSID_SimpleObject, NULL, CLSCTX_SERVER, pcsi, 1, &mq);
psci contains only the server name and all the other entrances are Null.
i suspect it has to do something with the NT security configuration.
Question by:hed
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

Author Comment

ID: 1200691
if i use
CoCreateInstance with CLSCTX_REMOTE_SERVER i get

A Remote Activation was necessary but was not allowed.
LVL 86

Accepted Solution

jkr earned 100 total points
ID: 1200692
You'll have to run dcomcnfg.exe on the remote server and change the security settings for the DCOM object you're using so that the client maching (and the user you're logged on on the client machine) are allowed to access this particular object on the server. If you're using a domain controller, the DC's user database is queried, if not, make sure that the same account (both user name and password) you're using on the client is also present on the server...

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

718 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