有没有办法判断两个 COM 接口引用是否指向同一个实例?
Given two interface references obtained from different sources. Is there a programmatic way to tell whether they're implemented by the same instance?
A simple equality check of the interface references always fails.
EDIT: Large parts of the original question, which turned out to be an independent problem have now been moved to a new question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查询 IUnknown 接口并比较这些指针。 不保证所有其他接口指针每次都返回相同的值。
来自组件对象模型的规则:
You could query for the IUnknown interface and compare these pointers. All other interface pointers are not guaranteed to return the same value each time.
from The Rules of the Component Object Model: