Solved

COM *ps.dll

Posted on 2003-12-03
4
263 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
[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
  • 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

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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.
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.

691 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