注册的 COM 类的最大长度是多少?
当对象被添加到 Windows 注册表时,它们会像这样显示:
MyNamespace.MyType
我似乎记得在尝试为 COM 注册它们时遇到了名称空间和类名太长的问题。在 Windows 或 COM+ 中注册类是否有最大长度限制?
When objects get added to the Windows Registry, they show up like so:
MyNamespace.MyType
I seem to remember running into issues with my namespaces and classnames being too long when trying to register them for COM. Is there a maximum length limitation in registering classes in Windows or COM+?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
来源 = MSDN
source = MSDN
注册 COM 组件的主要方法是通过它们的 CLSID,一个固定大小的 16 字节数。一个 GUID。您可以发布 ProgID,这对于需要使用后期绑定的 COM 客户端很有用。就像脚本语言一样。
我不知道 ProgID 是否有长度限制,COM 基础结构中没有定义长度限制。也许脚本语言有一个。我知道您使用的是 VB6,根本不需要 ProgID。它更喜欢早期绑定(new ClassName,而不是 CreateObject)。这是一个好主意,因为后期绑定调用大约慢 10,000 倍。
无论如何,如果您想指定 ProgId,请使用
属性。正常格式是 AppName.ClassName,很少会测试任何类型的长度限制。The primary way to register COM components is by their CLSID, a fixed size 16 byte number. A GUID. You can publish a ProgID, that's useful to COM clients that need to use late binding. Like scripting languages.
I have no idea if there's a length limit to ProgIDs, there isn't one defined in the COM infrastructure. Maybe the scripting language has one. I know you are using VB6, there's no need for a ProgID at all. It prefers early binding (new ClassName, not CreateObject). Which is a good idea because late bound calls are about 10,000 times slower.
Anyhoo, if you want to specify a ProgId then use the
<ProgId>
attribute. The normal format is AppName.ClassName, something that should rarely test any kind of length limit.说到“程序化 ID”的随机限制......
Speaking of a random limit on the the "Programmatic ID"...