Hi All,
I have a VB Project that connects to Mainframe Systems using Rumba Runtime 6.0
Recently I migrated this VB Project to VB.NET and now i am facing difficulty in consistantly Connecting to the Mainframe Host. Here is the function that is used. The Hostname that I use is a IP Address. Any help is greatly appriciated as this is a rarely used software by people.
Code:
Public Function TN3270_ConnectToHost(ByRef HostSession As Object, Optional ByRef HostName As Object = Nothing) As Integer
Dim I As Short
'Return if already connected
'UPGRADE_WARNING: Couldn't resolve default property of object HostName. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
'UPGRADE_WARNING: Couldn't resolve default property of object HostSession.HostInterface. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If (UCase(Trim(HostSession.HostInterface.Interface.ConnectedName)) = UCase(Trim(HostName))) Then
TN3270_ConnectToHost = 0
Exit Function
End If
'UPGRADE_WARNING: Couldn't resolve default property of object HostSession.Disconnect. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
HostSession.Disconnect()
System.Windows.Forms.Application.DoEvents()
'Set host address/name
'UPGRADE_NOTE: IsMissing() was changed to IsNothing(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="8AE1CB93-37AB-439A-A4FF-BE3B6760BB23"'
If (Not IsNothing(HostName)) Then
'UPGRADE_WARNING: Couldn't resolve default property of object HostSession.HostInterface. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
With HostSession.HostInterface.Interface
'UPGRADE_WARNING: Couldn't resolve default property of object HostSession.HostInterface. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
For I = .DestinationCount To 0 Step -1
'UPGRADE_WARNING: Couldn't resolve default property of object HostSession.HostInterface. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If (Len(Trim(.DestinationName2(I))) > 0) Then .DeleteName2(.DestinationName2(I))
Next
'UPGRADE_WARNING: Couldn't resolve default property of object HostSession.HostInterface. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
.InsertName2(HostName)
End With
End If
'Connect to host
'UPGRADE_WARNING: Couldn't resolve default property of object HostSession.Connect. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
HostSession.Connect()
System.Windows.Forms.Application.DoEvents()
'Wait until connected
If (Utility.GetWindowsVersion Like "5*") Then
TN3270_ConnectToHost = 0
Else
For I = 1 To 60
Sleep((500)) : System.Windows.Forms.Application.DoEvents()
'UPGRADE_WARNING: Couldn't resolve default property of object HostSession.HostConnected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If (HostSession.HostConnected) Then
If (Len(Trim(TN3270_GetScreen(HostSession))) > 0) Then Exit For
End If
Next
'UPGRADE_WARNING: Couldn't resolve default property of object HostSession.HostConnected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
TN3270_ConnectToHost = IIf(HostSession.HostConnected, 0, 1)
End If
Sleep((500))
End Function
Thanks in Adcance!
Chythra