根据这篇文章: http://msdn.microsoft.com/en-us/library/ms809975.aspx 您可以导出服务中的组件。
但是是否可以创建多个服务来导出同一组件的不同实例?
我看到一个潜在的问题是在定义\HKEY_CLASSES_ROOT\AppID\\LocalService 时,因为每项服务都有不同的名称,所以我不能将它们全部放在同一个 key 中。
谢谢
最佳答案
链接文章中非常明确地提到了这一点:
Do not use REGCLS_SINGLEUSE. Registration fails if you use this flag. The operating system allows a single instance of a service. For this reason, the COM component must be available to multiple clients simultaneously.
如果您想要它的多个实例,您必须使用常规的进程外服务器。
关于c++ - 多个服务导出相同的 COM 组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4647254/