Click here to Skip to main content
11,922,641 members (56,768 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#2.0 C# Windows Win7
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 ?
Posted 31-Jan-10 9:50am
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

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()
codetaino 13-Jan-12 7:56am
thanks this solved my problem!
011010 16-Feb-12 5:30am
Thanks a lot bro CreateControl() worked for me
rsdnitesh 21-Mar-12 10:05am
I am using AxMSTSCLib.AxMsTscAxNotSafeForScripting activex component for open RemoteDesktop on a windows forms code is given below

Dim RDP As New AxMSTSCLib.AxMsTscAxNotSafeForScripting
RDP.Server = "Servername"
RDP.UserName = "user"
Dim s As IMsRdpClientNonScriptable = DirectCast(RDP.GetOcx(), IMsTscNonScriptable)
s.ClearTextPassword = "PWD"

code works fine but when i run the program the control is not visible.

How to fix this??
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Look here

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151125.1 | Last Updated 13 Jan 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100