OleControl 实例化为错误类型 - 仅在 Reg Free COM 中使用时?
我有一个 ActiveX 控件(使用 C# 创建),我正在使用后期绑定将其添加到 Visual FoxPro 中的表单中。当我注册该控件时,它可以正常工作。
我想使用 reg free COM 并创建必要的清单文件。现在它加载并以非活动状态显示,直到我双击或以语法方式激活它。我不认为它与 reg free com 清单文件有任何关系。但是,在进行后期绑定调用 AddObject()
之前/之后,我需要做些什么来设置它吗?
this.AddObject('OleControl1', 'oleControl', 'SomeCompany.SomeOleControl')
当我检查由 AddObject()
创建的 OleControl 的 OleTypeAllowed
属性时,它是 1
(嵌入式 OLE 对象)而不是 -2
(ActiveX 对象)。因此 OleControl 被实例化为错误的类型。
我还尝试了以下操作:
DEFINE
OleControl
的子类并设置属性OleTypeAllowed = -2
。使用后期绑定来加载控件。它没有按要求工作。OleTypeAllowed
作为1
DEFINE
返回,是注册了 ActiveX 控件。使用可视化编辑器将 ActiveX 控件作为子类添加到项目中。取消注册该控件。使用后期绑定来加载控件。它没有按要求工作。
OleTypeAllowed
返回为1
。
是否可以将 OleControl 作为 ActiveX 控件加载?
任何可以转换为 FoxPro 的 VB 输入也将不胜感激。
I have an ActiveX control (created using C#) that I am adding to a form in Visual FoxPro using late binding. It works without problems when I register the control.
I want to use reg free COM and created necessary manifest files. Now it load and displays in an inactive state until I double click or grammatically activate it. I don't think it has anything to do with the reg free com manifest files. However is there something I need to do to set it up before/after making the late binding call AddObject()
?
this.AddObject('OleControl1', 'oleControl', 'SomeCompany.SomeOleControl')
When I check the OleTypeAllowed
Property of the OleControl created by AddObject()
it is 1
(Embedded OLE object) instead of -2
(ActiveX object). So the OleControl got instantiated to the wrong type.
I also tried the following:
DEFINE
a subclass ofOleControl
and set the propertyOleTypeAllowed = -2
. Used late binding to load the control. It did not work as required. TheOleTypeAllowed
came back as1
Registered the ActiveX control. Added the ActiveX control to the project as a subclass using the visual editor. Unregistered the control. Used late binding to load the control. It did not work as required. The
OleTypeAllowed
came back as1
.
Is it possible to load the OleControl as a ActiveX control?
Any input from VB that I can convert to FoxPro would also be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的
miscStatusContent
属性可能有误。这是我们部署的 VB6 应用程序清单中的片段:请注意,必须显式清除
miscStatus
。我们使用 UMMM 在我们的自动化构建中创建清单。
You probably have the
miscStatusContent
attribute wrong. This a snippet from a VB6 app manifest we deploy:Notice that
miscStatus
has to be explicitly cleared.We are using UMMM for manifest creation in our automated builds.