使用 MFC 在 COleControl 中实现自定义界面
我正在尝试为在 TLB 文件中定义接口的客户实现一个插件,他们使用该插件从我的系统获取视频。
我有一个基于 COleControl 的 ActiveX 控件,它需要实现此接口,但我无法弄清楚如何正确执行它。我正在使用 DISP_FUNCTION_ID 和 DISP_PROPERTY_ID 将方法/属性连接到 TLB 中的调度接口,但无法弄清楚如何注册我的类正在实现该接口,以便 QueryInterface 能够拾取它。
我对整个 COM 事物有点陌生,所以请保持温柔,但我们将不胜感激任何帮助:)
干杯,
Callum
I'm trying to implement a plugin for a customer who has an interface defined in a TLB file, which they use to get video from my system.
I've got an ActiveX control based on COleControl, which needs to implement this interface, but am having trouble figuring out how to do it correctly. I'm using DISP_FUNCTION_ID and DISP_PROPERTY_ID to hook up methods/properties to the dispinterface in the TLB, but can't figure out how to register that my class is implementing the interface so that QueryInterface will pick it up.
I'm kinda new to the whole COM thing, so please be gentle, but any help would be greatly appreciated :)
Cheers,
Callum
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TLB 文件为您提供了开发的定义。要注册组件,您实际上需要 COM dll。要注册 DLL,您需要“REGSVR32”命令(http://ss64.com/nt/regsvr32.html)。如果您无法将类创建为 COM 库的一部分,您可以参考示例 http: //www.codeproject.com/KB/atl/SimpleATLCom.aspx,这将为您提供简单的 COM 对象。
TLB file is giving you the definition for Development. To register the component you actually need the COM dll. To register the DLL you need "REGSVR32" command (http://ss64.com/nt/regsvr32.html). If you are not able to create your class as part of COM Library you can refer the example http://www.codeproject.com/KB/atl/SimpleATLCom.aspx, This will give you simple COM object.