Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with WaitForString in VB.NET

Status
Not open for further replies.

interim

MIS
Oct 15, 2002
6
AU
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top