使用 Reg-Free-COM 时,事件不会发送到基于 WPF 的 ActiveX 控件(COM 互操作)
我有一个基于 WPF 的 ActiveX 控件(COM 互操作)。我可以通过注册控件来正确使用它。当我尝试Reg-Free-COM(使用清单文件)时,控件似乎被激活,但事件(例如鼠标单击、RequestBringIntoView 等)没有响应。有趣的是,双击和 Tab 键可以工作。
我在这篇文章中读到 http:// blogs.msdn.com/karstenj/archive/2006/10/09/activex-wpf-gadget.aspx “...这些优点是有代价的:ActiveX 控件必须在注册表中注册,这需要某种安装,例如 .msi。默认的小工具安装过程无法安装 ActiveX。ActiveX 控件无法通过免注册 COM 访问...”
有人有类似的经历吗?谁能解释一下发生了什么事吗?
其他详细信息:
当控件在注册后被激活时,它会作为 COM 客户端 UI 的一部分出现。控件不接收焦点,其元素接收焦点。
使用 reg-free-com 时,控件无法正确加载。 1) 控件接收焦点而不是其子元素 2) 控件的某些区域是黑色的,而不是窗口默认颜色 3)当我进出控件或双击它时,它的子元素接收焦点,控件开始接收事件,并且黑色区域被正确的颜色替换
I have a WPF based ActiveX control (COM interop). I am able to use it correctly by registering the control. When I tried to Reg-Free-COM (using manifest files) the control seems to be activated, but the events (such as mouse click, RequestBringIntoView etc) dont respond. Interestingly, Double click and tab key works.
I read in the this article http://blogs.msdn.com/karstenj/archive/2006/10/09/activex-wpf-gadget.aspx that " ... These upsides come with a price: the ActiveX control must be registered in the registry, which requires some kind of installation such as an .msi. The default gadget installation process cannot install ActiveX. The ActiveX control can't be access via reg-free COM. ..."
Has anybody had a similar experience? Can anyone explain what is going on?
Additional details:
When the control is activated after it has been registered it appears as part of the COM client's UI. The control does not receive focus, its elements receive it.
When using reg-free-com the control does not load correctly.
1) The control receives focus instead of its sub elements
2) The control has areas that are black instead of the windows default color
3) when I tab in and out of the control or double click it, it's subelements receive focus, the control starts receiving events and the black areas are replaced by the correct color
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现该控件处于非活动状态,因为需要在注册 COM 时设置的 MiscStatus 属性才能激活它。我将就此发布一个单独的问题。
I discovered that the control was inactive because the miscStatus attribute which is set on registering COM is required to activate it. I will post a separate question on that.