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. COM Server (exe) as a Service

COM Server (exe) as a Service

Scheduled Pinned Locked Moved COM
questioncomsysadmin
2 Posts 1 Posters 1 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.
  • D Offline
    D Offline
    darkbyte
    wrote on last edited by
    #1

    Hello everyone, I'm currently working on a COM Server that i want to be a Service and i'm pretty close to get it to work but ... When i start the COM Server manually all seems to work fine, i can create multiple objects and they will all use my currently running process. When i start the COM Server as a service, the scripting app does not want to use the Service for a source, instead it starts another instance of my application. I do call CoInitializeSecurity and set permissions so that anyone can access the library. Not sure what is preventing my Service to be accessed. Anyone has a clue ? DarkByte

    D 1 Reply Last reply
    0
    • D darkbyte

      Hello everyone, I'm currently working on a COM Server that i want to be a Service and i'm pretty close to get it to work but ... When i start the COM Server manually all seems to work fine, i can create multiple objects and they will all use my currently running process. When i start the COM Server as a service, the scripting app does not want to use the Service for a source, instead it starts another instance of my application. I do call CoInitializeSecurity and set permissions so that anyone can access the library. Not sure what is preventing my Service to be accessed. Anyone has a clue ? DarkByte

      D Offline
      D Offline
      darkbyte
      wrote on last edited by
      #2

      Ok, i found part of my answer in MSDN .. yaya !! :) The Library article located in Component Development -> Component Object Model (General) -> Technical Articles -> Creating and Registering COM Components with LocalService gave me a big help to get further in my development process but i still fail and one part of the article seems to be my answer, except i'm not too sure how to handle it. Here is the part i'm talking about: Coding a COM component in a service is much like coding a traditional service. In the primary thread, start the service dispatcher thread. Next, expose a COM component through the service and not through the primary thread of the service application. Place the COM-specific code in the service. Finally, create proxies to expose the component's interfaces to any clients. The bold text is what seems to be my answer, but i'm confused as to how to make it. i figured out how to get dlldata.c, _h.h, _i.h, _p.?. So, do i just need to create a dll out of these files ? What kind of registration is required for the Proxy to use my service ? What about UUID's ? Do the proxy component need new UUID's ? I guess being redirected to a good article that talk about proxy/server could help me be less confused. BTW, i'm not using ATL/MFC or whatever .. i edit my IDL file manually. Well, i use MFC but not the COM part of it. Thanx in advance for any hints DarkByte [edit]: Issue was solved by just defining the LocalService key as described in the documentation. My last problem was thinking i was recompiling the Debug version when i actually was recompiling the Release version :doh:

      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