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

DCOM

Scheduled Pinned Locked Moved COM
com
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.
  • I Offline
    I Offline
    itkid
    wrote on last edited by
    #1

    Hi, I am new to COM.I have one application(Say simulator) which is interacting with control software on the same machine.Now i want to it to work through remote machine.Can you please let me know how this functionality can be achieve.If you know similar url please let me know. Thanks

    M 1 Reply Last reply
    0
    • I itkid

      Hi, I am new to COM.I have one application(Say simulator) which is interacting with control software on the same machine.Now i want to it to work through remote machine.Can you please let me know how this functionality can be achieve.If you know similar url please let me know. Thanks

      M Offline
      M Offline
      Mayur Mahajan
      wrote on last edited by
      #2

      Assuming you are not using smart pointers, the code will go as follows: { COSERVERINFO csi = {0}; MULTI_QI qi[1] = {0}; //Init pwszname to computer name of remote server where ur COM server //is to be deployed csi.pwszName = L"xxxx"; //use proper comp name here qi[0].pIID = &IID_IFoo; //Init to interface you wish to obtain HRESULT hr=CoCreateInstanceEx(CLSID_Foo,NULL,CLSCTX_REMOTE_SERVER,&csi,1,qi); if(SUCCEEDED(hr)) { m_pFoo=(IFoo*)qi[0].pItf; //you got the interface for remote machine. //Do your work here } } This method is to programatically set up the connection to remote server Another easy method is to register your COM server on both the local and remote machine. Launch 'dcomcnfg' on the maching you plan to run client. Find your COM server from the objects in the list view, right click and click 'properties'. Check the box 'Run this component on' and key in the name of the remote machine you paln to install your COM server. That should work fine. No significant changes are required to the basic functionality of the COM server and the migration to DCOM server should be breeze ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      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