How to handle a System.Windows.Forms.Axhost + InvalidActiveXState exception

I am developing a program that should read duration realplayer file and then install it in timer.Interval, when I debug a program, there are no errors, but when I try to get the length of the file, I get this error: System.Windows.Forms.Axhost+InvalidActiveXState exception. I am using an assembly called AxRealAudioObjects.dll, its version 2.0. I remember that it worked very well on .NET 2.0, but since the current version of .NET is 4.0, it gives this error. Is the dll damaged or is it something else?

+3
source share
2 answers

From MSDN: "An exception that is thrown when an ActiveX control is referenced during an invalid state." In this case, you cannot do anything to “handle” this error; COM / ActiveX is in an unknown state. There is an error in the code, an error in the ActiveX control code, or else. Make sure you use ActiveX in the support form.

0
source

Most ActiveX controls have a method CreateControl(), call this first. if the control is not displayed after the call CreateControl()the call Refresh()next

0
source

Source: https://habr.com/ru/post/1791294/


All Articles