If an InvalidActiveXStateException Error is Received
This error is due to the
ActiveX Control not being
completely initialized when the textBox1_TextChanged event is called as
the form loads. This behavior is by design in VS.NET and is largely due
to the relative slowness of calling ActiveX controls in the managed code
environment.

The workaround is to handle the error using a try|catch statement and
then re-attempt the offending code after the component has been completely
initialized.
An example of the try | catch in VB would be:
Try
AxBarCode1.DataToEncode = TextBox1.Text
Catch
ex As
AxHost.InvalidActiveXStateException
End Try
© Copyright 2002-2009 IDAutomation.com, Inc., All Rights
Reserved. Legal
Notices.
|
Over 70% of Fortune 100
companies use IDAutomation products to automate their businesses.
|
|