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