Click here to Skip to main content
15,899,679 members
Home / Discussions / COM
   

COM

 
GeneralComponent Accessibility Pin
Robert Findlay27-Apr-05 2:52
Robert Findlay27-Apr-05 2:52 
GeneralRe: Component Accessibility Pin
Robert Findlay9-May-05 1:07
Robert Findlay9-May-05 1:07 
GeneralNeed help about Office Automation Pin
figer25-Apr-05 21:47
figer25-Apr-05 21:47 
GeneralRe: Need help about Office Automation Pin
Jason Henderson26-Apr-05 8:16
Jason Henderson26-Apr-05 8:16 
GeneralRe: Need help about Office Automation Pin
vishalmore11-May-05 21:13
vishalmore11-May-05 21:13 
GeneralAcitveX container hanging problem Pin
kostik125-Apr-05 21:17
kostik125-Apr-05 21:17 
GeneralDCOM Pin
itkid25-Apr-05 19:32
itkid25-Apr-05 19:32 
GeneralRe: DCOM Pin
Mayur Mahajan26-Apr-05 17:21
Mayur Mahajan26-Apr-05 17:21 
Assuming you are not using smart pointers, the code will go as follows:
{
COSERVERINFO csi = {0};

MULTI_QI qi[1] = {0};




//Init pwszname to computer name of remote server where
ur COM server
//is to be deployed
csi.pwszName = L"xxxx"; //use proper comp name here



qi[0].pIID = &IID_IFoo; //Init to interface you wish to obtain

HRESULT hr=CoCreateInstanceEx(CLSID_Foo,NULL,CLSCTX_REMOTE_SERVER,&csi,1,qi);

if(SUCCEEDED(hr))

{

m_pFoo=(IFoo*)qi[0].pItf;



//you got the interface for remote machine.
//Do your work here
}
}

This method is to programatically set up the connection to remote server
Another easy method is to register your COM server on both the local and remote machine. Launch 'dcomcnfg' on the maching you plan to run client. Find your COM server from the objects in the list view, right click and click 'properties'. Check the box 'Run this component on' and key in the name of the remote machine you paln to install your COM server.

That should work fine. No significant changes are required to the basic functionality of the COM server and the migration to DCOM server should be breeze

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GeneralHandling COM Events Pin
i.chen24-Apr-05 20:34
sussi.chen24-Apr-05 20:34 
GeneralRe: Handling COM Events Pin
Frank_lgh9-May-05 14:45
Frank_lgh9-May-05 14:45 
GeneralC to MASM, troubles while converting. Pin
Brean24-Apr-05 11:34
Brean24-Apr-05 11:34 
GeneralActiveX controls on web pages Pin
Hugo Hallman24-Apr-05 11:01
Hugo Hallman24-Apr-05 11:01 
GeneralRe: ActiveX controls on web pages Pin
vishalmore11-May-05 21:17
vishalmore11-May-05 21:17 
GeneralRe: ActiveX controls on web pages Pin
Hugo Hallman12-May-05 1:27
Hugo Hallman12-May-05 1:27 
QuestionHow can we typecast the Exported Function pointers of a DLL Pin
sijis21-Apr-05 22:26
sijis21-Apr-05 22:26 
AnswerRe: How can we typecast the Exported Function pointers of a DLL Pin
Peter Ritchie23-Apr-05 7:36
Peter Ritchie23-Apr-05 7:36 
QuestionHow can I set DCOMCNFG Settings programmatically? Pin
Danillo21-Apr-05 4:49
Danillo21-Apr-05 4:49 
AnswerRe: How can I set DCOMCNFG Settings programmatically? Pin
Jason Henderson25-Apr-05 7:08
Jason Henderson25-Apr-05 7:08 
GeneralError : "The procedure number is out of range." Pin
Ed K19-Apr-05 10:56
Ed K19-Apr-05 10:56 
GeneralRe: Error : "The procedure number is out of range." Pin
Peter Ritchie23-Apr-05 7:38
Peter Ritchie23-Apr-05 7:38 
GeneralRe: Error : "The procedure number is out of range." Pin
Ed K23-Apr-05 7:47
Ed K23-Apr-05 7:47 
GeneralOut of proc Interface Implementation Problem Pin
thomas_tom9917-Apr-05 23:27
thomas_tom9917-Apr-05 23:27 
GeneralRe: Out of proc Interface Implementation Problem Pin
Anonymous18-Apr-05 4:18
Anonymous18-Apr-05 4:18 
GeneralRe: Out of proc Interface Implementation Problem Pin
Peter Ritchie23-Apr-05 7:43
Peter Ritchie23-Apr-05 7:43 
GeneralISyncMgrRegister and other Interfaces Pin
MichaelPine17-Apr-05 21:55
MichaelPine17-Apr-05 21:55 

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.