Using Terminal Launcher With Non-HLLAPI-Compliant Emulators

You can use Terminal Launcher with Terminal Emulators that do not support HLLAPI but do support scripting that is able to call external .dll files. To do this, you must create a script that asks SecureLogin for commands one at a time and then interprets the commands received.


Configuring Reflection 8 for UNIX and Digital

The following script has been tested with Reflection 8 for UNIX and Digital.

Sub SecureLogin() 
Dim SecureLoginObject As ISLBroker
Dim ReturnCode As Long
Dim Data As String
Dim targ As Long
Dim FunctType As Long
Dim CR As String
Dim temp As String
 Session.Wait 0.1'The waits are necessary for the screen to be updated.
 Set SecureLoginObject = New SLBroker 
CR = Chr$(rcCR) ' Chr$(rcCR) = Chr$(13) = Control-M
SecureLoginObject.LoadScript
While (1 = 1)
FunctType = 0
'retrieve command from VBABork
SecureLoginObject.GetCommand FunctType, targ, Data
If FunctType = SecureLoginObject.SetCursor Then
' SetCursor is not supported
ReturnCode = 0
ElseIf FunctType = SecureLoginObject.TypeText Then
If (StrComp(Data, "@E", vbTextCompare) = 0) Then
Session.Transmit CR
Else
Session.Transmit Data
End If
Session.Wait 0.1
ReturnCode = 0
ElseIf FunctType = SecureLoginObject.ScanForText Then
bResult = Session.FindText(Data, Session.ScreenTopRow, 0)
ReturnCode = 0
If bResult = True Then
ReturnCode = 1
End If
Else
' End of script
GoTo ErrorHandler
End If
SecureLoginObject.SetReturnCode ReturnCode
Wend
ErrorHandler:
End Sub

The script should also work for Reflection 7. Reflection 6 and earlier versions require a different Reflection script because these versions use Reflection Basic instead of VBA (Visual Basic for Applications). If you require a script for Reflection 5.21, contact Novell Support.

To use Reflection for UNIX and Digital, you must add the Sub SecureLogin() script by using the macro editor in Reflection. In addition to adding this macro, you must go to the macro editor, select Tools > References, and check the check box titled vbabork2 1.0 Type Library.

If this option is not displayed, ensure that vbabork2.dll exists in the SecureLogin directory. If it does not, re-install SecureLogin, making sure to select Terminal Launcher.

If the vbabork2 1.0 Type Library option displays, you must register it.

  1. Open a DOS shell.

  2. Enter regsvr32 followed by the path to vbabork2.dll.

    For example, enter

    regsvr32 "C:\Program Files\SecureLogin\ vbabork2.dll"

    A message should indicate that DllRegisterServer succeeded.

  3. Add the reference to this module in Reflection as described above.

Only one session can be launched at a time using SecureLogin. To run the script, you must run the SecureLogin script macro after the session has been opened. This can be done automatically in Reflection by selecting Connect Macro from the Connection Setup menu.

By doing this procedure, the SecureLogin script macro will run every time the session is opened. Without this procedure, you will need to manually run the script macro when you want to run the script.

To run the script, you must set up the emulator in Terminal Launcher.

  1. Launch Terminal Launcher, then click Edit Available Emulators. Set up the emulators as usual, but set the HLLAPI type to None.

  2. Select the emulator.

  3. Type anything in the hllapi dll and HLLAPI Function boxes.

  4. Click OK, then click Done.


Configuring Reflection 9 for UNIX and Digital

  1. Open Reflection for UNIX and Digital.

  2. Click Macro at the top of the screen, then select Visual Basic Editor.

  3. After the editor loads, click Tools at the top of the screen, then click References.

  4. Scroll to vbabord2 1.0 Type Library, then check the check box.


    The check box for vbabord2 1.0 Type Library
  5. Return to the main editor screen, then double-click This Session, which is on the far left of the screen.


    Main editor screen with This Session displayed
  6. Copy and paste the macro into the editor.

    You can type text in the right pane of the screen. Type or copy and paste the following macro:

    Sub SecureLogin() 
    Dim SecureLoginObject As ISLBroker
    Dim ReturnCode As Long
    Dim Data As String
    Dim targ As Long
    Dim FunctType As Long
    Dim CR As String
    Dim temp As String
      Session.Wait 0.1 'The waits are necessary for the screen 
    to be updated.
      Set SecureLoginObject = New SLBroker 
    CR = Chr$(rcCR) ' Chr$(rcCR) = Chr$(13) = Control-M
    SecureLoginObject.LoadScript
    While (1 = 1)
    FunctType = 0
    'retrieve command from VBABork
    SecureLoginObject.GetCommand FunctType, targ, Data
    If FunctType = SecureLoginObject.SetCursor Then
    ' SetCursor is not supported
    ReturnCode = 0
    ElseIf FunctType = SecureLoginObject.TypeText Then
    If (StrComp(Data, "@E", vbTextCompare) = 0) Then
    Session.Transmit CR
    Else
    Session.Transmit Data
    End If
    Session.Wait 0.1
    ReturnCode = 0
    ElseIf FunctType = SecureLoginObject.ScanForText Then
    bResult = Session.FindText(Data,
    Session.ScreenTopRow, 0)
    ReturnCode = 0
    If bResult = True Then
    ReturnCode = 1
    End If
    Else
    ' End of script
    GoTo ErrorHandler
    End If
    Session.Wait 0.1
    SecureLoginObject.SetReturnCode ReturnCode
    Wend
    ErrorHandler:
    End Sub
  7. Click File > Close, then click Exit to exit from the editor.

  8. Click Open Connection at the top of the screen, then click Connection Setup.

    This is where you set up the host name and protocol that you are connecting to the mainframe.

  9. Click Connect Macro and browse to the macro you just created.

  10. Open Tlaunch.exe, then click Edit Available Emulators > New.

    This step creates a new emulator.

  11. Select a VBA emulator type, then type the required settings.


    VBA Emulator Configuration dialog box
  12. Create a script for the emulator to use.