Remote COM
-
RevathiRamakumar wrote:
Should i Need to do anything else
Nope.
RevathiRamakumar wrote:
Should I create proxy/stub for my application? If so ,how can build proxy/stub?
Nope. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Thank u.. But then, Im not able to connect to the remote COM...What should be wrong then? Thank u..
-
Thank u.. But then, Im not able to connect to the remote COM...What should be wrong then? Thank u..
I don't know. You should possibly post your calling code.BTW, what was the
CoCreateInstanceEx
return value? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
I don't know. You should possibly post your calling code.BTW, what was the
CoCreateInstanceEx
return value? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]This is my client code that calls the COM server on the remote machine...Thank u.. HRESULT hr; IIGetFile2* pGetFile; // IUnknown* pUnknown = 0; COSERVERINFO ServerInfo = {0,0,0,0}; wchar_t * remotemachine = L"servername"; ServerInfo.pwszName = remotemachine; //MULTI_QI qi = {&__uuidof(IGetFile2),NULL,S_OK}; MULTI_QI qi={0,0,0}; qi.pIID = &IID_IUnknown; // IIGetFile2 * pInt = static_cast<IIGetFile2 *>(qi.pItf); USES_CONVERSION; CComPtr<IIGetFile2> Ptr1; qi.pIID = &IID_IIGetFile2; // hr = CoCreateInstanceEx(CLSID_IGetFile2,NULL,CLSCTX_REMOTE_SERVER,&ServerInfo,1, &qi); pUnknown = (IUnknown*)qi.pItf; if(SUCCEEDED(hr)) { AfxMessageBox("SUCCEEDED CoCreateEX"); } pUnknown = (IUnknown*)qi.pItf; hr = pUnknown->QueryInterface(IID_IIGetFile2, (void**)&pGetFile); hr = pUnknown->Release(); if(SUCCEEDED(hr)) { AfxMessageBox("SUCCEEDED QI"); _bstr_t bstrFileContent = pGetFile->GetFile2(); char* Text = _com_util::ConvertBSTRToString(bstrFileContent); m_edit=Text; UpdateData(FALSE); }
-
This is my client code that calls the COM server on the remote machine...Thank u.. HRESULT hr; IIGetFile2* pGetFile; // IUnknown* pUnknown = 0; COSERVERINFO ServerInfo = {0,0,0,0}; wchar_t * remotemachine = L"servername"; ServerInfo.pwszName = remotemachine; //MULTI_QI qi = {&__uuidof(IGetFile2),NULL,S_OK}; MULTI_QI qi={0,0,0}; qi.pIID = &IID_IUnknown; // IIGetFile2 * pInt = static_cast<IIGetFile2 *>(qi.pItf); USES_CONVERSION; CComPtr<IIGetFile2> Ptr1; qi.pIID = &IID_IIGetFile2; // hr = CoCreateInstanceEx(CLSID_IGetFile2,NULL,CLSCTX_REMOTE_SERVER,&ServerInfo,1, &qi); pUnknown = (IUnknown*)qi.pItf; if(SUCCEEDED(hr)) { AfxMessageBox("SUCCEEDED CoCreateEX"); } pUnknown = (IUnknown*)qi.pItf; hr = pUnknown->QueryInterface(IID_IIGetFile2, (void**)&pGetFile); hr = pUnknown->Release(); if(SUCCEEDED(hr)) { AfxMessageBox("SUCCEEDED QI"); _bstr_t bstrFileContent = pGetFile->GetFile2(); char* Text = _com_util::ConvertBSTRToString(bstrFileContent); m_edit=Text; UpdateData(FALSE); }
Fine. Is your server machine name
"servername"
(or simply is the name in your real code correct? What about thehr
(theCoCreateinstanceEx
return value)? And what aboutqi.hr
value? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Fine. Is your server machine name
"servername"
(or simply is the name in your real code correct? What about thehr
(theCoCreateinstanceEx
return value)? And what aboutqi.hr
value? :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]No, Its RDSServer ..I have given it correctly...:confused: CoCreateinstanceEx hr=-2147023174 and for qi.hr I get access violation exception...
-
No, Its RDSServer ..I have given it correctly...:confused: CoCreateinstanceEx hr=-2147023174 and for qi.hr I get access violation exception...
Your error code corrensponds to: "
Error 0x800706ba - The RPC server is unavailable
" see, for instance, this page [^] for some info. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Your error code corrensponds to: "
Error 0x800706ba - The RPC server is unavailable
" see, for instance, this page [^] for some info. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Thank u...Let me try out... :)
-
Thank u...Let me try out... :)
Hi...I have another doubt..In case of testing both client and server on the local machine I have used this include statement... #import "..\FileServer\FileServer.tlb" using namespace FILESERVERLib; But, When testing the server on the remote machine what kind of import statement Should I give..? Thank u...
-
Hi...I have another doubt..In case of testing both client and server on the local machine I have used this include statement... #import "..\FileServer\FileServer.tlb" using namespace FILESERVERLib; But, When testing the server on the remote machine what kind of import statement Should I give..? Thank u...
The import statement is used, on the client side, to build the client itself. It has nothing to with the testing phase (i.e. use always such statement to build the client and then forget about it...) :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
The import statement is used, on the client side, to build the client itself. It has nothing to with the testing phase (i.e. use always such statement to build the client and then forget about it...) :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Thank u..So,u mean to say that it has nothing to do with my remote access...Right..
-
Thank u..So,u mean to say that it has nothing to do with my remote access...Right..
Hi.. I tried the code.. When I'm trying to create an instance on the remote machine I get ACCESS DENIED error.. I have the security permissions for the DCOM though.. Thank U...:confused: