Late binding from COM client
-
Hi I am reading this article: http://www.ddj.com/cpp/184403558 It says: Suppose you want to call methods on a COM object or Automation Server, but have no header files, type library (discussed later), or any programmatic information about the object. Late binding is what makes this possible. In fact, with late binding you can even instantiate and use a COM object [2] on a remote machine. And in his code:
wcscpy(progid, L"comcalc.calc"); CLSIDFromProgID( progid, &pclsid); HRESULT hr = CoCreateInstance(pclsid, NULL, CLSCTX_ALL, IID_IDispatch, (void **)&idsp);
While late binding , If we have nothing (no need) about COM object in remote server. How could CLSIDFromProgId work? Something must be registered in client computer before executing this line so we need dll/exe file(server) itself. Am i wrong? I don't understand how CLSIDFromProgId could work here. Thanks... Edit/Delete Message -
Hi I am reading this article: http://www.ddj.com/cpp/184403558 It says: Suppose you want to call methods on a COM object or Automation Server, but have no header files, type library (discussed later), or any programmatic information about the object. Late binding is what makes this possible. In fact, with late binding you can even instantiate and use a COM object [2] on a remote machine. And in his code:
wcscpy(progid, L"comcalc.calc"); CLSIDFromProgID( progid, &pclsid); HRESULT hr = CoCreateInstance(pclsid, NULL, CLSCTX_ALL, IID_IDispatch, (void **)&idsp);
While late binding , If we have nothing (no need) about COM object in remote server. How could CLSIDFromProgId work? Something must be registered in client computer before executing this line so we need dll/exe file(server) itself. Am i wrong? I don't understand how CLSIDFromProgId could work here. Thanks... Edit/Delete Messagesawerr wrote:
wcscpy(progid, L"comcalc.calc"); CLSIDFromProgID( progid, &pclsid); HRESULT hr = CoCreateInstance(pclsid, NULL, CLSCTX_ALL, IID_IDispatch, (void **)&idsp); While late binding , If we have nothing (no need) about COM object in remote server. How could CLSIDFromProgId work? Something must be registered in client computer before executing this line so we need dll/exe file(server) itself. Am i wrong?
IMHO the above code snippet is executed on the remote machine, where the
COM
server is registered. :)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.