My application has two executable (*.exe) files. The main program will start the secondary executable as a child process. The child process quickly calls CoCreateInstance(..., CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, ...) using the class id of the COM server hosted by the main program.
The problem is that if I start multiple instances of the main program, the child process might not always choose the parent process as its COM server. From what I can tell, the child process always chooses the first started instance of the main program.
Is there any way you can tell COM which process id to use as your local COM server?