Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RPC server is Unavailable..

Status
Not open for further replies.

Binka

Programmer
Feb 19, 2004
1
0
0
KR
Hello there.,
I am trying to connect to a remote server . For broadcasting purpose (Pushing a Stream to a Windows Media Server) , I necessarily have to connect to the Media Server and create an object in there prior to start my broadcasting using DCOM . I tried with the following code ..
------------------------------------------------------------
CString m_strServerName = "ServerName" ;
CString m_strPublishPoint1 = "publishpointName" ; //Used for Broadcasting

ZeroMemory(&cs, sizeof(cs));
cs.pwszName = m_strServerName.AllocSysString();
cs.pAuthInfo = NULL;

// Create a MULTI_QI structure to hold an IUnknown pointer
// to an IWMSServer interface.
ZeroMemory(&mqi, sizeof(mqi));
mqi.pIID = &IID_IWMSServer;
mqi.pItf = NULL;
mqi.hr = 0;

// Retrieve a pointer to the IWMSServer interface.
hr = CoCreateInstanceEx(CLSID_WMSServer,NULL,CLSCTX_LOCAL_SERVER |CLSCTX_REMOTE_SERVER,&cs,1,&mqi);
if (FAILED(hr))
{
return hr;
}

// The MULTI_QI structure contains an IUnknown pointer. Call
// QueryInterface to retrieve a pointer to IWMSServer.

hr = mqi.pItf->QueryInterface(IID_IWMSServer,(void**) &pRemoteServer);
------------------------------------------------------------
The server can be remote also... What are the things I have to take care of .?

Can anyone guide me in this regard.?

Kindly Help me.. Thanks..!

Best Regards,
DK.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top