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: running COM-server on another PC

DCOM: running COM-server on another PC

Scheduled Pinned Locked Moved COM
questioncomsysadminlinux
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.
  • B Offline
    B Offline
    Bash
    wrote on last edited by
    #1

    Hi Guys! I'm novice in DCOM and my question will be very easy. I'm created COM-server and its COM-client. I can successfully run both on the same machine and successufully run on the separate machine (with modification in dcomcnfg). The code is not changed when remote running. I used the follows (it works fine): IEncoder * pEncoder; HRESULT hr=CoCreateInstance(CLSID_Encoder, NULL, CLSCTX_SERVER, IID_IEncoder, (void **)&pEncoder); I'm trying to specify exactrly on which machine COM-server should be run using the follows: WCHAR *wszMachineName=L"STAR\0"; COSERVERINFO srv; ZeroMemory(&srv,sizeof(srv)); srv.pwszName=wszMachineName; MULTI_QI qi; HRESULT hr=CoCreateInstanceEx(CLSID_Encoder, NULL, CLSCTX_SERVER, &srv, 1, &qi); This returns E_INVALIDARG. :( What should I do to remotely invoke my COM-server from another machine using CoCreateInstanceEx() ? Yours sincerely, Alex Bash

    A 1 Reply Last reply
    0
    • B Bash

      Hi Guys! I'm novice in DCOM and my question will be very easy. I'm created COM-server and its COM-client. I can successfully run both on the same machine and successufully run on the separate machine (with modification in dcomcnfg). The code is not changed when remote running. I used the follows (it works fine): IEncoder * pEncoder; HRESULT hr=CoCreateInstance(CLSID_Encoder, NULL, CLSCTX_SERVER, IID_IEncoder, (void **)&pEncoder); I'm trying to specify exactrly on which machine COM-server should be run using the follows: WCHAR *wszMachineName=L"STAR\0"; COSERVERINFO srv; ZeroMemory(&srv,sizeof(srv)); srv.pwszName=wszMachineName; MULTI_QI qi; HRESULT hr=CoCreateInstanceEx(CLSID_Encoder, NULL, CLSCTX_SERVER, &srv, 1, &qi); This returns E_INVALIDARG. :( What should I do to remotely invoke my COM-server from another machine using CoCreateInstanceEx() ? Yours sincerely, Alex Bash

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      Have you defined _WIN32_DCOM in your client? Also, you might want to set the MULTI_QI (qi in your case) memeber pIID to the address of the interface you are requesting to be returned and then try calling CoCreateInstanceEx. Hope this helps. :)

      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