Hi All,
I have a program that works fine in VB 6.0 using Attachmate KEA. I am now trying to convert it to VB.NET and to work with Attachmate EXTRA.
Here is the code for the waitforstring function (not in its entirety):
VB 6.0 Version
Set Sess = sessns.Item(scrnLocation)
Set Screen_Object = Sess.Screen
Set waitforstringobject = Screen_Object.WaitForString("Please Enter:")
Do While waitforstringobject <> "Please Enter:"
Loop
VB.NET Version
extraSess = extraSessns.Item(scrnLocation)
extraScreen = extraSess.Screen
waitforstringobject = extraScreen.WaitForString("Please Enter:")
Do While waitforstringobject Is Nothing
Loop
Yes, I have created an EXTRA object.
The problem is that I am getting this error when it gets to the waitforstring command:
An unhandled exception of type 'System.InvalidCastException' occurred in Project1.exe
Additional information: Specified cast is not valid.
Also, I can't seem to get WaitForString to actually wait unless i put in a loop after it (as above). Anyone else curious about this?
The VB 6.0 code works fine. Any ideas?
Thanks,
Michael.
I have a program that works fine in VB 6.0 using Attachmate KEA. I am now trying to convert it to VB.NET and to work with Attachmate EXTRA.
Here is the code for the waitforstring function (not in its entirety):
VB 6.0 Version
Set Sess = sessns.Item(scrnLocation)
Set Screen_Object = Sess.Screen
Set waitforstringobject = Screen_Object.WaitForString("Please Enter:")
Do While waitforstringobject <> "Please Enter:"
Loop
VB.NET Version
extraSess = extraSessns.Item(scrnLocation)
extraScreen = extraSess.Screen
waitforstringobject = extraScreen.WaitForString("Please Enter:")
Do While waitforstringobject Is Nothing
Loop
Yes, I have created an EXTRA object.
The problem is that I am getting this error when it gets to the waitforstring command:
An unhandled exception of type 'System.InvalidCastException' occurred in Project1.exe
Additional information: Specified cast is not valid.
Also, I can't seem to get WaitForString to actually wait unless i put in a loop after it (as above). Anyone else curious about this?
The VB 6.0 code works fine. Any ideas?
Thanks,
Michael.