0

I need to implement an out-of-process com server which initiates a com process per client process. An answer to this same question suggests using different GUID's for each server.

My COM server is ATL & I invoke it simple by CoCreateInstance. The question is what are the steps for implementing the suggestion in above link? At what stage should CoRegisterClassObject be called (Currently it isn't called at all)? Would it replace some existing registration? How will the client & server coordinate generated GUID: the server(client) should get the client(server) pid somehow.

Also I would like to hear if there are other approaches for solving the one server process per calling process issue.

EDIT: BTW, if I run one process from within VS debugger and 2nd by dbl-click, two server processes are created!

grunt
  • 662
  • 1
  • 8
  • 24
  • ATL calls CoRegisterClassObject implicitely for you with CLSCTX_LOCAL_SERVER and REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED for parameters. If you want to change this, just override (add it to the class) the `HRESULT RegisterClassObjects(_In_ DWORD dwClsContext, _In_ DWORD dwFlags)` method implementation in the CAtlExeModuleT that was generated by the ATL template and change the dwFlags value. However, by default, you should pretty much get the same server process for the same client process on subsequent client calls. Have you really tried this? – Simon Mourier Apr 03 '19 at 10:10
  • @Simon Mourier - the problem is I get same server process for multiple clients. – grunt Apr 03 '19 at 11:29
  • Different processes are created when the COM server is configured to launch as the interactive user and the COM clients are executed in different security contexts (i.e., by different users). The same user in the same security context running multiple COM clients would still use only one process. – J.R. Apr 04 '19 at 11:55

0 Answers0