System.Windows.Forms.AxHost.InvalidActiveXStateException was unhandled

Nisar picture Nisar · Mar 29, 2014 · Viewed 21k times · Source

I am continuously struggling with this exception

An unhandled exception of type 'System.Windows.Forms.AxHost.InvalidActiveXStateException' occurred in AxInterop.SBXPCLib.dll

any help please, am i missing some thing.

Answer

Vishal I Patil picture Vishal I Patil · Mar 29, 2014

Try this,it will solve your problem:

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

So try this:

axMDocView1.CreateControl()