Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Late binding from COM client

Late binding from COM client

Scheduled Pinned Locked Moved COM
c++wpfwcfcomsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sawerr
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • S sawerr

      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

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups