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.
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.