【发布时间】:2015-08-19 11:03:38
【问题描述】:
在我维护的软件中,我观察到 COM 类 标有相同的 [ProgId]s。
AFAIK ProgId 是组件的人类可读标识符,它应该与组件的 CLSID 一对一映射。
所以我想知道:
是否有充分的理由为不同的类设置相同的 ProgId?
可能的后果是什么? (除非无法使用这种方便的方式访问组件)
提前致谢。
【问题讨论】:
-
你应该阅读this MSDN topic。重要部分:
ProgIDs are automatically generated for a class by combining the namespace with the type name,和ProgIDs are limited to 39 characters and can contain no punctuation other than a period。 -
@EBrown 在我的情况下,所有 ProgId 都使用此属性显式设置为相同的值。该值是应用程序的名称。 (也许开发人员认为“ProgId”是“程序标识符”所以项目/应用程序的名称......)