When BlueZone is running in the Visual Basic application, it can be controlled using a COM object called the BlueZone Host
Automation Object. It is instantiated using the CreateObject method. Once created, any of the BlueZone Host Automation Object's methods and properties can be called by your Visual Basic
application.
The following sample code shows the correct way to instantiate the BlueZone Host Automation Object and launch a BlueZone session:
Option Explicit
Dim bzhao As Object
Private Sub Form_Unload(Cancel As Integer)
bzhao.Disconnect
End Sub
Private Sub Sglw2hcm1_AfterConnect(ByVal Success As Long)
Set bzhao = CreateObject("BZWhll.WhllObj")
bzhao.Connect "A"
bzhao.WaitForText "Choice:", 23, 7, 10
bzhao.SendKey "3"
bzhao.WaitReady 0, 100
bzhao.SendKey "@E"
bzhao.WaitReady 0, 100
bzhao.SendKey "3"
bzhao.WaitReady 0, 100
bzhao.SendKey "@E"
End Sub
Once a BlueZone session is launched successfully, configure it and save the setting to the profile specified in the Sessions tab.
The above sample code is designed to work with BlueZone VT. To use it as a test, follow these steps:
|
1. |
Use BlueZone Desktop or BlueZone Web-to-Host to launch a BlueZone VT emulation session. |
|
2. |
Configure the session to automatically connect to the Library of Congress host using the following host address:
|
|
3. |
In addition to host IP address and port, make any additional configuration changes at this time. All BlueZone features including
the keyboard map, display colors, display font, toolbar settings, etc. are contained in the BlueZone configuration file. |
|
4. |
Save the BlueZone VT configuration and name it test.zvt. |
|
5. |
Create a Visual Basic Project, insert the BlueZone Web-to-Host control module in a form and ensure that your BlueZone Web-to-Host
control module is configured properly.
Refer to the following topics for more information:
|
|
6. |
Insert the above sample code into your Visual Basic project. |
|
7. |
Click the Start icon to run the application . BlueZone VT launches in the form.
|
|
8. |
Connect to the Library of Congress host and select menu item number 3, Federal Legislation, then select item number 2, Congress,
1983-84. |
The above sample code demonstrates the ability for BlueZone VT to automatically connect to a host, wait for a specific string
of characters to appear on the screen, and navigate to a specific location on the host.