You left some critical information about your own application, including the most important thing, how do you implement the COM interfaces that you open for the client application. One aspect of your description, which is a red flag for me, is creating your application. You say that the client application "uses VB to start a new process, referencing our exe." This is not necessary if you correctly executed and registered your COM server. Let me tell you about the architecture that I would use to accomplish what you are asking, and I hope this will be useful to you.
For starters, if you want to provide a COM object from a separate process, the correct way is to implement a COM server. If there is no process server, COM starts your application automatically when the client requests one of your interfaces through COM. Part of the requirements for executing outside the process server is to automatically shut down when the last COM client releases its last interface pointer.
To bring the user interface out of the processing server, you want to create a separate single-threaded apartment (STA) stream with a message loop. This will allow you to close any window in the STA stream, including the main window, without killing your COM server. This is because the implementation of the COM server will start its own stream of message flows with multiple threads (MTA) to support COM calls from proc. The MTA thread is the main thread of the application, and the server will disable it when the last client interface is deleted.
The COM server should not stop while the interfaces remain unreleased. This means that the client application is responsible for properly releasing the interfaces. But your .NET test frame was supposed to do this, so something seems wrong with your implementation.
Assuming you are following this guide, you will need a script processing plan in which the last client interface will be released, but you still have open user interface windows. Once you're set up correctly, this should not be a serious problem. For example, you can simply take a link to one of your own interfaces while the user interface is open, this will prevent the MTA from stopping.
source share