
01-15-2012, 09:11 AM
|
 |
Ultimate Contributor
Preferred language: C#, VB
|
|
Join Date: Jun 2003
Location: USA
Posts: 2,096
|
|
Re: 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown
|
Based on what Google has to say, System.Windows.Forms.AxHost.InvalidActiveXStateException is often thrown when you try to access an ActiveX component that is not fully initiailized. (It's hard to do more than guess and Google when I don't know anything about the control in question.)
Not being much of an expert on the subject, if the Axpass.Axiepass class is written as an ActiveX control, I'm wondering whether the problem could be related to the fact that after you instantiate it, you don't place it in a control. After all, you don't get the exception when you place the control on a form.
The empty string that gets returned could likely be a completely separate issue. I have no idea what the function does, how it does it, or whether it does it 100% right. (Just because it works in VB6 doesn't mean everything is 100% kosher. It's possible to do something incorrectly and still have it succeed in certain circumstances.) You can try double-checking the ActiveX source to make sure everything looks spiffy, and you should definitely check and make sure you are using the control exactly the same in .NET that you are in VB6. Maybe there's an initialization method that needs to be called or a property that needs to be set. The .NET WinForms designer may also be setting some properties that the VB6 designer did not, or vice-versa.
|
__________________
|