I wrote an OLE automation server (using Delphi). I usually start the OLE server manually and use it as a normal application. From time to time I start a client, which automatically connect to the existing OLE Server.
When I terminate the client, the server does not terminate (at least when it was started manually before the client) but it won’t accept any other OLE connection. Starting another client will trigger a new server instead of reusing the first one.
How can I reuse the same server with the second client?
(Question edited to reformulate it correctly. In the original version I was asking how to prevent the server from terminating, which wasn’t a good formulation)
There is a setting ‘Instancing’ in the COM Object Wizard in Delphi. Allowed values are ‘internal’, ‘Multiple Instance’, ‘Single Instance’.
I wanted to reuse the same COM server with multiple clients. That is why I chose ‘single Instance’ and though that I would have a single instance of my server application for all the clients. But I was wrong. ‘Single Instance’ means that there will be only one instance of a COM connection in my server. I should have chosen ‘Multiple Instance’ to allow multiple COM connection (but one after the other, not simultaneous) in the same server.
I think that the words used in the COM Object Wizard in Delphi are not really clear. Instead of ‘multiple instance’, ‘single instance’, it would be better to have ‘multiuse’ and ‘single use’ like in this article about OLE Server and VB.