Create new process for every class of COM server -


i created outproc com server, implements classa , classb. factories of both classes registered coregisterclassobject(regcls_singleuse, clsctx_local_server).

when client app calls cocreateinstance(classa) system creates process of com server. when client app calls cocreateinstance(classa) again system creates additional process of com server. when client app call cocreateinstance(classb) system not create new process, uses created. 2 classes work in same process.

is there way force system create new process every class of com server?

solution (thanks hans passant):

during registration of com server add additional parameter process path. looks this:

windows registry editor version 5.00  [hkey_classes_root\clsid\{classx_clsid}\localserver32] @="c:\\path\\server.exe -classx" 

and when process starts -classx params in command line , call coregisterclassobject when present.

the problem com server starts , registers class factories supports. application start , registers class factories classa , classb.

if create object of type classa, registration class factory in process discarded. if make request classa new process must started.

but classb may have still valid registration factory of first launched process.

so regcls_singleuse means single use 1 class. if have more registered classes each class may used once.

you unregister other classes corevokeclassobject when 1 object created.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -