Solved

COM *ps.dll

Posted on 2003-12-03
4
245 Views
Last Modified: 2010-04-01
Hi,
I have a com service built on VC++ 7.1, I have my service exe and ps.dll, as I know for a client machine to communicate with a service it needs only to register ps.dll, then it has to call CoCreateInstanceEx with coserverinfo server name set to "MyServerName".
Then I read in MSDN that it could be done with CoCreateInstance (without -Ex), I have to set context to CLSCTX_REMOTE_SERVER and there should be RemoteServerName value somewhere in registry.

So do I understand it right? And where should be RemoteServerName value in registry??
0
Comment
Question by:GiedriusS
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
_ys_ earned 100 total points
ID: 9906940
It is indeed possible with CoCreateInstance.

The structure of the registry would be this:
The HKCR\CLSID\{xxxx} key would have an 'AppId' string value and it's data would be another guid (1) - typically this is the same as the CLSID.

The HKCR\AppId key would have a sub-key (1), and it would have a 'RemoteServerName' string value, the data specifiying the remote server name.

And yes, it is better to explicitly state CLSCTX_REMOTE_SERVER.

[HKCR refers to the HKEY_CLASSES_ROOT hive]
0
 
LVL 9

Expert Comment

by:_ys_
ID: 9906962
Should have mentioned.

Using CoCreateInstanceEx with coserverinfo server name set to "MyServerName" allows you to bypass the RemoteServerName stored within the registry. RemoteServerName can be viewed as a 'default'.
0
 
LVL 5

Expert Comment

by:migoEX
ID: 10364866
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept _ys_'s comment as answer.

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

migoEX
EE Cleanup Volunteer
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

708 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

11 Experts available now in Live!

Get 1:1 Help Now