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. What is the RIGHT WAY to dispose of COM Server

What is the RIGHT WAY to dispose of COM Server

Scheduled Pinned Locked Moved COM
comquestionsysadminhelpannouncement
2 Posts 1 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
    Bill Wilson
    wrote on last edited by
    #1

    What is the correct method to stop an OLE server? I have a service (A.exe)that creates 3 objects in an OLE full server (B.exe). This causes the server application to be launched. As the various objects are instantiated, they come into existence just fine. When the service stops, it releases the three objects, but the server application doesn't go away. One of the objects in B.exe does have a Stop method that is called by the service as it stops. This is used to stop a bunch of worker threads that live in one of the COM objects. I can cause the program to quit when I A invokes the Stop method in B, but this jerks the objects out from under the service (A) that created them, causing all sorts of ugly things to happen when it tries to release them. Does any one know what the "right way" to do this is? My first thought was that the server .exe would stop when all of its objects were released. This does not appear to be the case (or is something wrong with their destructors, causing them to not release). Should I post a message to the main app's thread? If I do, I still need it to live until the objects have been released (or do I?). Please help, I'm beginning to confuse myself. :confused: Thanks, Bill Thanks for the help, Bill

    B 1 Reply Last reply
    0
    • B Bill Wilson

      What is the correct method to stop an OLE server? I have a service (A.exe)that creates 3 objects in an OLE full server (B.exe). This causes the server application to be launched. As the various objects are instantiated, they come into existence just fine. When the service stops, it releases the three objects, but the server application doesn't go away. One of the objects in B.exe does have a Stop method that is called by the service as it stops. This is used to stop a bunch of worker threads that live in one of the COM objects. I can cause the program to quit when I A invokes the Stop method in B, but this jerks the objects out from under the service (A) that created them, causing all sorts of ugly things to happen when it tries to release them. Does any one know what the "right way" to do this is? My first thought was that the server .exe would stop when all of its objects were released. This does not appear to be the case (or is something wrong with their destructors, causing them to not release). Should I post a message to the main app's thread? If I do, I still need it to live until the objects have been released (or do I?). Please help, I'm beginning to confuse myself. :confused: Thanks, Bill Thanks for the help, Bill

      B Offline
      B Offline
      Bill Wilson
      wrote on last edited by
      #2

      The server .exe will exit when all instances of all objects are released. Thanks for the help, Bill

      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