Click here to Skip to main content
11,583,865 members (42,949 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 Win7
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 ?
Posted 31-Jan-10 8:50am
Rate this: bad
good
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()
  Permalink  
v2
Comments
codetaino at 13-Jan-12 7:56am
   
thanks this solved my problem!
011010 at 16-Feb-12 5:30am
   
Thanks a lot bro CreateControl() worked for me
rsdnitesh at 21-Mar-12 10:05am
   
Hi,
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.CreateControl()
RDP.Server = "Servername"
RDP.UserName = "user"
Dim s As IMsRdpClientNonScriptable = DirectCast(RDP.GetOcx(), IMsTscNonScriptable)
s.ClearTextPassword = "PWD"
RDP.Connect()

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

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

Solution 2

Look here http://social.msdn.microsoft.com/forums/en-US/winforms/thread/d403fa2a-4388-42f2-a18e-dff1cd748732/
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 430
1 Sergey Alexandrovich Kryukov 314
2 virusstorm 268
3 Richard Deeming 220
4 Dave Kreskowiak 200
0 OriginalGriff 1,623
1 Sergey Alexandrovich Kryukov 1,135
2 Abhinav S 701
3 Dave Kreskowiak 627
4 Suvendu Shekhar Giri 568


Advertise | Privacy | Mobile
Web03 | 2.8.150603.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