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. exe com server problem?

exe com server problem?

Scheduled Pinned Locked Moved COM
c++comsysadminhelptutorial
5 Posts 4 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.
  • G Offline
    G Offline
    G Richard
    wrote on last edited by
    #1

    I have write a exe com server. It can run more than one instance. When my client exe call createinstance, it always connect to the first started one, but i want my client exe to popup a dialog to choose one to connect. Is Any body konw how to it? thanks! c++ : my dream

    L D 2 Replies Last reply
    0
    • G G Richard

      I have write a exe com server. It can run more than one instance. When my client exe call createinstance, it always connect to the first started one, but i want my client exe to popup a dialog to choose one to connect. Is Any body konw how to it? thanks! c++ : my dream

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      When you do a create instance you specify the CLSID of your server which is unique and hence you are getting connected to the the first instance. Personally I think your EXE being an Out Of Process COM Server should be single instance and support MTA. Please, Correct me if I am wrong. ------------------------- Have a great day ahead! Regards, Sohail Kadiwala (My COM Blog - http://lovecom.blogspot.com)

      G 1 Reply Last reply
      0
      • L Lost User

        When you do a create instance you specify the CLSID of your server which is unique and hence you are getting connected to the the first instance. Personally I think your EXE being an Out Of Process COM Server should be single instance and support MTA. Please, Correct me if I am wrong. ------------------------- Have a great day ahead! Regards, Sohail Kadiwala (My COM Blog - http://lovecom.blogspot.com)

        G Offline
        G Offline
        G Richard
        wrote on last edited by
        #3

        Right it is out of process, but it is not single instance. The server is started first and can run serveral instance, which one is for a purpose. c++ : my dream

        L 1 Reply Last reply
        0
        • G G Richard

          Right it is out of process, but it is not single instance. The server is started first and can run serveral instance, which one is for a purpose. c++ : my dream

          L Offline
          L Offline
          Lim Bio Liong
          wrote on last edited by
          #4

          Hello Richard, I believe that in general, it is not possible to control the actual instance of your COM exe server from which to create your COM object. This remains the privilege of the COM system. One thing that -is- controllable, however, is whether a new instance of your COM exe server is launched whenever a new instance of your COM object is created. Visual Basic allows for setting this. I think that at runtime, the COM system refers to some value in the registry to determine whether a new instance of your COM server is to be launched. I really do not know what is the registry key to refer. I'll let you know once I find this out. Hope the above helps, Richard. Regards, Bio.

          1 Reply Last reply
          0
          • G G Richard

            I have write a exe com server. It can run more than one instance. When my client exe call createinstance, it always connect to the first started one, but i want my client exe to popup a dialog to choose one to connect. Is Any body konw how to it? thanks! c++ : my dream

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

            I think you're seeing the situation the wrong way. Your COM server should be Unique but think of it as the entry point for what you really need to be in multiple instances. For example, see it as getting the handle of an Excel Application object, then you would want your client app to be able to select or create a new Excel Workbook. So, Basicly, Client App gets a Handle to the COM server primary object which might contain a collection of SomeAppInstance that your client application can present to the user. The user is presented with 3 choices, 1) Select an instance, 2) Create a new instance, 3) Cancel Selection/Connection. Hope this applies to your needs.

            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