Click here to Skip to main content
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 9: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 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 OriginalGriff 120
3 PIEBALDconsult 110
4 Zoltán Zörgő 99
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 13 Jan 2011
Copyright © CodeProject, 1999-2014
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