I created outproc COM server, it implements ClassA and ClassB. Factories of both classes are registered with CoRegisterClassObject(REGCLS_SINGLEUSE, CLSCTX_LOCAL_SERVER).
When client app calls CoCreateInstance(ClassA) system creates process of my COM server. When client app calls CoCreateInstance(ClassA) again system creates additional process of my COM server. But when client app call CoCreateInstance(ClassB) system does not create new process, it uses already created. So two classes work in the same process.
Is there a way to force system to create new process for every class of COM server?
Solution (thanks to Hans Passant):
During registration of COM server I just add additional parameter to process path. Now it looks like this:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{ClassX_CLSID}\LocalServer32]
@="C:\\Path\\Server.exe -ClassX"
And when process starts I look for -ClassX params in command line and call CoRegisterClassObject only when it present.