Invalid ActiveX State Exception

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to edit form elements (labels, text box's, etc) in Visual Studio.NET using VB.NET. Whenever I edit certain forms’ appearance whether it is through the code, or through the designer, I receive this (Invalid ActiveX State Exception) error message at runtime whenever the form is called. I am simply trying to change the size and location of some form elements whose location and size were thrown off during the upgrade from VB6.0 to VB.NET. These are not major changes, just a few pixels at most. In addition, after I get this error, the form that I tried to edit is hosed. It throws this runtime error even if I reverse the changes that I made to the form. It is as if something is changing that is not visible. I make sure that everything in the code is changed back to its original state, but still receive this error message. Any suggestions are greatly appreciated.
 
Are you using any non .Net controls, such as ActiveX?
I have had this exact problem in this case.
Has to do with the forms Property Bag being different between .Net and VB6.

Gerald

Evan Delodder said:
I am trying to edit form elements (labels, text box's, etc) in Visual
Studio.NET using VB.NET. Whenever I edit certain forms' appearance whether it is
through the code, or through the designer, I receive this (Invalid ActiveX State
Exception) error message at runtime whenever the form is called. I am simply
trying to change the size and location of some form elements whose location and
size were thrown off during the upgrade from VB6.0 to VB.NET. These are not
major changes, just a few pixels at most. In addition, after I get this error,
the form that I tried to edit is hosed. It throws this runtime error even if I
reverse the changes that I made to the form. It is as if something is changing
that is not visible. I make sure that everything in the code is changed back to
its original state, but still receive this error message. Any suggestions are
greatly appreciated.
 
I am using listviews, dropdown lists, toolbars and some other stuff too. What can I do to fix this problem, or at least make it go away peacefully? Thanks for your response and I appreciate any further help you can provide.

Evan
 
Hmm...
You don't say if these are legacy ActiveX or not.
If it is a .Net issue, then there might be a code answer or tinkering with the
forms resource file.
In my case, I was having problems during design-time more than run-time.
Although if I tried to access the ActiveX control while the form is not
displayed at run-time, then it would also crash.
In the end, I had to remove all the ActiveX controls and associated Interop
references.
I then needed to manually import the type libraries using TLBIMP to recreate the
Interop libraries.
Then re-add the references and controls.
Even in that case, it did not solve the problem for all the controls, but it did
for most of them.

I'm sure that is not the answer you were looking for, and in fact there may be a
better way, but I have yet to find it.
Hope this provides some help.

Gerald

Evan Delodder said:
I am using listviews, dropdown lists, toolbars and some other stuff too. What
can I do to fix this problem, or at least make it go away peacefully? Thanks for
your response and I appreciate any further help you can provide.
 
Back
Top