IBM Books

Host Access ActiveX Controls


Host Access ActiveX Controls

Host On-Demand and Personal Communications provide a set of Host Access ActiveX Controls for use in ActiveX development environments. The following controls are available:

The controls function and behave identically to the Host Access Beans, so the beans documentation can also be used as a reference for the controls. See Introduction to the Host Access Beans for descriptions of the controls, as well as the properties and methods of each. See your ActiveX development tool documentation for help on using ActiveX controls.

The same ActiveX controls are installed by Personal Communications and Host On-Demand, so only one set of controls from either Host On-Demand or Personal Communications will function on a single workstation. If the controls are installed by both products, the controls from the last product installed will be used. In addition, if the last product installed is later removed, the controls will be disabled until either Host On-Demand or Personal Communications is reinstalled.

The ActiveX controls were generated by wrapping the Host Access Beans for Java in ActiveX wrappers using Sun's ActiveX Bridge technology. The controls have registry entries like normal ActiveX controls, and they have a common OCX file called beans.ocx. Beans.ocx is a thin ActiveX wrapper around the beans which interfaces with the beans as they run inside a Java Runtime Environment or JRE.

The ActiveX controls and their dependent files are contained under the toolkit subdirectory in the install directory (usually C:\Program Files\IBM\Host Access Toolkit) of the Host On-Demand Toolkit installation. The ActiveX controls will only be installed as part of the toolkit; they may be in another directory chosen during the install of the toolkit.) Most of the required files reside under the toolkit\activex directory, but the .jar files containing the beans reside under the toolkit\jars directory.

To copy the ActiveX controls from a Host On-Demand installation to another Windows 9x or Windows NT (4.0 or higher) workstation, do the following steps on the target workstation:

  1. Create the installation directory. For the sake of simplicity, it is recommended that you maintain the same install path on the target workstation.
  2. Create a toolkit\activex directory in the installation directory.
  3. Copy the toolkit\activex directory from the Host On-Demand installation to the new toolkit\activex directory.
  4. Create a toolkit\jars directory in the installation directory.
  5. Copy *.jar from toolkit\jars directory in the Host On-Demand installation to the new toolkit\jars directory.
  6. If the installation directory has been changed, update the registry files in the new toolkit\activex directory to reflect the new path.
  7. Change to the toolkit\activex directory and run register.bat to update the Windows registry.
PComm-unique
In Personal Communications, the ActiveX controls and their dependent files can be found in the directory where Personal Communications was installed, usually C:\Program Files\Personal Communications.

Note: You must have the appropriate licensing to run the ActiveX controls on each workstation. See the licensing agreement of the installing product for more information.

Using the Host Access Controls to Communicate with a Host System

To connect to a host, your program must first create either a Terminal or Session ActiveX control. A Terminal control would be used when you want a visible display of the session. A Session control should be used when you don't want the session to be visible. The Terminal/Session is the connection to your host. You need to set the Host property of Terminal/Session control to the name of the host to which you want to connect.

Host = ralvm17
For Personal Communications, the host name must be the name of an existing .ws profile. The above sample code would work if you had a .ws profile named "ralvm17.ws". Normally the .ws profile files are found in the private subdirectory of the Personal Communications install directory.

See your ActiveX tool documentation for help on setting ActiveX control properties.

Once the host name is set, communications with the host can be started by calling the startCommunication method.

Terminal1.startCommunication

In the example above, 'Terminal1' is the name given to the first instance of the Terminal Control in a Visual Basic application. See your ActiveX tool documentation for the appropriate syntax for invoking methods.

Troubleshooting

If you are using Visual Basic, you will receive the following error message if the controls are not set up properly.

If you are using Visual C++, you will receive the following error message if the controls are not set up properly.

When automatically installed, you should not see these problems, but if you have manually installed the controls on a workstation these errors may occur if you have set them up incorrectly. These problems are usually caused if the .jar files required by the Host Access Controls cannot be found or if the registry entries are incorrect. Retrace the steps for manually installing the controls on a new workstation, and double-check the directory paths. Be sure that you correctly updated the registry files and ran register.bat.


[ Top of Page | Previous Page | Next Page | Table of Contents ]