AxHost.InvalidActiveXStateException [英] AxHost.InvalidActiveXStateException

查看:143
本文介绍了AxHost.InvalidActiveXStateException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.
我有您网站上有关OCR的代码.但这不起作用

抛出AxHost.InvalidActiveXStateException

我有VS2008 Windows 7 x64 Office 2007

下一行


this.axMiDocView1 =新的AxMODI.AxMiDocView();

在我之前的监视列表中

ActionState"axMiDocView1.ActionState"引发了类型为"System.Windows.Forms.AxHost.InvalidActiveXStateException"的异常MODI.MiActionState {System.Windows.Forms.AxHost.InvalidActiveXStateException}

与其他字段相同.
如何解决此问题?

Hello.
I have code about OCR from your site. But it doesnt work

throw AxHost.InvalidActiveXStateException

I have VS2008 windows 7 x64 Office 2007

after line


this.axMiDocView1 = new AxMODI.AxMiDocView();

in watch list I have for ex

ActionState ''axMiDocView1.ActionState'' threw an exception of type ''System.Windows.Forms.AxHost.InvalidActiveXStateException'' MODI.MiActionState {System.Windows.Forms.AxHost.InvalidActiveXStateException}

and the same for other fields.
how can I fix this problem ?

推荐答案

对于每个活动x控件,都需要首先创建它,以便所有事件和句柄都应初始化.

使用axMiDocView1.CreateControl()
For each and every active x control, it is needed to create it first, so that all the events and handles should be initialized.

Use axMiDocView1.CreateControl()


猜猜我会说MiDocView控件的ActionState设置为在Office 2007下不再有效的值.
在设计模式下打开Form1,然后选择axMiDocView1控件,然后查看该控件的属性,在Misc下,有一个名为ActionState的属性,将其设置为其他值,然后看看会发生什么.您可能还需要删除并阅读对MODI ocx控件的引用.
At a guess I would say that the ActionState of the MiDocView control is set to a value that is no longer valid under Office 2007.

Open Form1 in design mode and select the axMiDocView1 control, then look at the properties for the control, under Misc there is a property called ActionState, set this to a different value and see what happens. You may need to remove and readd the reference to the MODI ocx control as well.


查看此处http://social.msdn.microsoft.com/forums/en-US/winforms/线程/d403fa2a-4388-42f2-a18e-dff1cd748732/
Look here http://social.msdn.microsoft.com/forums/en-US/winforms/thread/d403fa2a-4388-42f2-a18e-dff1cd748732/


这篇关于AxHost.InvalidActiveXStateException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆