我可以监视对 VisualBasic 6 ActiveX 控件的 COM 调用吗?
我在 VisualBasic 6 中编写了一个小 ActiveX 控件,它将用作某些第 3 方框架的插件。该框架期望我的控件公开一些属性和方法。一切似乎都运行良好,只是我的一个属性似乎被忽略了。
在 C++ 中,我可以将调试语句放入 IDispatch::GetIDsOfNames
和 IDispatch::Invoke
的重新实现中,以查看框架尝试访问哪些成员 - 也许文档是错误的,并且它需要不同的属性名称或其他名称。
是否也可以在 Visual Basic 6 中监视对 COM 属性/方法的访问?
I wrote a little ActiveX control in VisualBasic 6 which is going to be used as a plugin for some 3rd party framework. The framework expects that my control exposes a few properties and methods. It all seems to work well except that one of my properties seems to be ignored.
In C++, I could put debug statement into the reimplementations of IDispatch::GetIDsOfNames
and IDispatch::Invoke
to see which members the framework attempts to access - maybe the documentation is wrong, and it's expecting a different property name or something.
Is it possible to monitor the accesses to COM properties/methods in Visual Basic 6, too?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最简单的方法是在相关方法/属性中添加某种形式的日志记录。我不认为你可以挂钩较低级别的 COM 调用。
对于日志记录,您可以使用
OutputDebugString()
。The easiest way is to add logging of some form in the methods/properties in question. I don't think you can hook the lower level COM calls though.
For the logging, you can use
OutputDebugString()
.有一本相当古老的“Hardcore Visual Basic”书,它教你如何在 VB5/6 中实现 IUnknown、IDispatch 等。
There's a rather old 'Hardcore Visual Basic' book around that teaches you exactly how to implement IUnknown, IDispatch etc. in VB5/6.