Click here to Skip to main content
15,902,802 members
Home / Discussions / COM
   

COM

 
QuestionHow to delete a COM object Pin
AmitGG27-Feb-06 20:30
AmitGG27-Feb-06 20:30 
AnswerRe: How to delete a COM object Pin
mbue27-Feb-06 22:07
mbue27-Feb-06 22:07 
GeneralRe: How to delete a COM object Pin
AmitGG27-Feb-06 22:21
AmitGG27-Feb-06 22:21 
GeneralRe: How to delete a COM object Pin
mbue27-Feb-06 23:29
mbue27-Feb-06 23:29 
GeneralRe: How to delete a COM object Pin
AmitGG28-Feb-06 0:05
AmitGG28-Feb-06 0:05 
GeneralRe: How to delete a COM object Pin
mbue28-Feb-06 3:51
mbue28-Feb-06 3:51 
QuestionConnecting Multiple clients to single server using DCOM Pin
abhiramsss27-Feb-06 18:21
abhiramsss27-Feb-06 18:21 
AnswerRe: Connecting Multiple clients to single server using DCOM Pin
FearlessBurner6-Mar-06 1:51
FearlessBurner6-Mar-06 1:51 
I cannot give you an example, but I can tell you how to set one up for yourself, assuming that you have some knowledge of COM. If you have any problems with these suggestions, that you will need to consult the help documentation, or post a simple question. Before I start, I would like to say that operation of DCOM is much the same as the operation of COM. If you get the server and clients to work together on the same computer, then all you need to do is to change a few calls, and make sure that the security privileges are set, and then everything should work. Unfortunately, security is not a trivial matter, and you will probably have to study it for yourself, in order to get everything working.

Firstly create a com out-of-process exe server, with your desired remote interface included.

Secondly create a client application that is able to use the above created server interface on your local computer. Use CoCreateInstanceEx() to create the instance of the interface, setting the "ServerComputerName" to your local computer name eg:

<br />
<br />
COSERVERINFO csi = {0};<br />
csi.pwszName = L"ServerComputerName"<br />
csi.pAuthInfo = NULL;<br />
<br />
MULTI_QI qi[1] = {0};<br />
qi[0].pIID = &IID_IMyInterface<br />
if ( SUCCEEDED( CoCreateInstanceEx(CLSID_MyInterface, NULL, CLSCTX_REMOTE_SERVER, &csi, 1, qi ) )<br />
{<br />
   CMyInterface *pMyInterface =  static_cast<IMyInterface *>( qi[0].pItf);<br />
   // Use the created pMyInterface and release it if no longer needed<br />
}<br />


Test it to make sure your server interface works as anticipated. When it does, you can replace ServerComputerName with the actual intended server.

Security is the number one headache when programming DCOM. Inserte calls to CoInitializeSecurity() in the server and client InitInstance() like this:
	<br />
CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_NONE,RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);<br />


which will reduce the security checking.

Install the server onto another computer by registering it and running it. Use DCOMCNFG to check that permissions have been set so that remote users have access to your server program. You may also need to set the COM default limits. You should be able read up on using DCOMCNFG in any good COM documentation. Finally on XP etc, check that the firewall will allow this program to allow/have access to remote users.

You may also need to set the firewall on the client computer to allow your computer program to connect out.

If all the steps have been followed successfully, then you should be able to connect multiple clients to same server version.

Lastly, if you get stuck, there are several good com server articles on CP that may also be able to assist you.
-- modified at 7:52 Monday 6th March, 2006
GeneralRe: Connecting Multiple clients to single server using DCOM Pin
abhiramsss8-Mar-06 19:10
abhiramsss8-Mar-06 19:10 
GeneralRe: Connecting Multiple clients to single server using DCOM Pin
abhiramsss9-Mar-06 23:31
abhiramsss9-Mar-06 23:31 
GeneralRe: Connecting Multiple clients to single server using DCOM Pin
FearlessBurner10-Mar-06 0:18
FearlessBurner10-Mar-06 0:18 
GeneralRe: Connecting Multiple clients to single server using DCOM Pin
abhiramsss12-Mar-06 20:09
abhiramsss12-Mar-06 20:09 
GeneralRe: Connecting Multiple clients to single server using DCOM Pin
abhiramsss13-Mar-06 22:30
abhiramsss13-Mar-06 22:30 
GeneralRe: Connecting Multiple clients to single server using DCOM Pin
FearlessBurner16-Mar-06 4:25
FearlessBurner16-Mar-06 4:25 
GeneralRe: Connecting Multiple clients to single server using DCOM Pin
abhiramsss19-Mar-06 21:24
abhiramsss19-Mar-06 21:24 
GeneralRe: Connecting Multiple clients to single server using DCOM Pin
FearlessBurner22-Mar-06 6:51
FearlessBurner22-Mar-06 6:51 
QuestionAutomation Server Can't Create Object Pin
bigmacrox27-Feb-06 12:46
bigmacrox27-Feb-06 12:46 
AnswerRe: Automation Server Can't Create Object Pin
mbue27-Feb-06 16:18
mbue27-Feb-06 16:18 
QuestionODBC dropping cell values Pin
RB@Emphasys27-Feb-06 5:30
RB@Emphasys27-Feb-06 5:30 
QuestionDrag-and-Drop in explorer.exe. Pin
Jerry New26-Feb-06 17:20
Jerry New26-Feb-06 17:20 
AnswerRe: Drag-and-Drop in explorer.exe. Pin
mbue27-Feb-06 16:21
mbue27-Feb-06 16:21 
QuestionCOM Component... Pin
Siva Sankar Koyi24-Feb-06 21:13
Siva Sankar Koyi24-Feb-06 21:13 
AnswerRe: COM Component... Pin
Lim Bio Liong24-Feb-06 23:31
Lim Bio Liong24-Feb-06 23:31 
GeneralRe: COM Component... Pin
AmitGG28-Feb-06 22:11
AmitGG28-Feb-06 22:11 
QuestionImplement a new interface Pin
zubair_ahmed23-Feb-06 19:32
zubair_ahmed23-Feb-06 19:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.