Introducing HostExplorer APIs
As part of the latest business trend, companies are rethinking how to access valuable information from the mainframe. Programmers need to create applications that make better use of host information. They need application programming interfaces (APIs) to allow for PC-to-host or UNIX-to-host communication.
HostExplorer provides a wide range of APIs that let you automate and use HostExplorer functionality from within your own programs and scripts.
With programming languages such as C++ and Basic, you can use the methods and properties within these APIs to customize HostExplorer to suit your needs or those of your customers. For example, you can use these APIs to:
- redesign a graphical user interface (GUI) in an application
- incorporate an application into a Web page
- create interactive Web sites
HostExplorer APIs are based on the following popular standards:
- OLE (Object Linking and Embedding) automation
- COM (Component Object Model)
- OHIO (Open Host Interface Objects)
OLE Automation
OLE Automation is a Windows tool that lets you automate the exchange of data between applications, and lets you access and control HostExplorer.
For more information, see OLE Automation.
HostExplorer COM Objects
COM objects provide methods and properties that let you manipulate the behavior of objects and create relationships between objects. These objects offer the most efficient means of accessing an application’s features and functionality, and they can be used by any COM-compliant application. You can use a COM object to make a direct call, and the system returns a pointer to that interface.
Note: |
Methods and properties for TN3270 and TN5250 terminal types do not apply to Hummingbird Connectivity SecureTerm. |
HostExplorer provides the following COM objects, which allow you to seamlessly integrate HostExplorer functionality within your own applications:
- Terminal objects
Note:
The three Terminal objects (3270, 5250, and VT) are ActiveX objects that let you embed the HostExplorer terminal into your own applications. - Profile object
- Parser objects
- Transport objects
A functional diagram illustrates how objects work together to access host data from the mainframe.
The most common libraries are:
- HostExplorer 3270 Type Library
- HostExplorer 5250 Type Library
- HostExplorer VT Type Library
- HESession 1.0 Type Library
In Visual Basic, you can add the visual controls (for example, 3270, 5250, and VT type libraries) to the project by clicking Component on the Project menu. You can add objects such as HESession and HEOhio by clicking References on the Project menu. When you add the objects, they become available in a drop-down menu. Using this drop-down menu, you can select objects in Dim statements, as well as other Visual Basic statements.
When you are using the visual controls and you add the basic object, this object is displayed on the component bar. When you add the selected control to a form in the project, Visual Basic automatically creates the object. In the following example, Visual Basic automatically creates the Session and Transport objects. Visual Basic automatically creates other objects after you connect to the session, therefore, you must assign references to these objects. In the following example, the active control is named My3270 in the project. This control is an instance of the HE3270Terminal object that you added as a visual component to the project:
Example:
-
Dim MySession As HESession
Dim MyTransport As Object
…
Set MySession = My3270.Session
Set MyTransport = My3270.Transport
OHIO
OHIO is a developing standard; it addresses the need for a standardized programming interface to host data. HostExplorer provides Ohio interfaces, which contain methods and properties that you can use to access different types of host data.
The Ohio object consists of classes, such as OhioManager and OhioSession, as described in the draft IETF standard.
In Visual Basic, you typically declare objects in one of the following formats:
After you add the HEOhio 1.0 Type Library, the most common library for Ohio, to the project references list, either of the two formats will work. OhioManager, OhioSession, and HEOHIOLib appear in the drop-down menu that is displayed when you type the Visual Basic “AS” keyword.
Note: |
In Ohio, you must create the object as follows: | |
|
Set OManager=CreateObject("HEOhio.OhioManager") |
Legacy APIs
In addition to COM objects and OHIO, HostExplorer provides the following existing (or “legacy”) APIs:
- EHLLAPI (Extended HLLAPI) and WinHLLAPI (Windows HLLAPI)—Allow other Windows programs (for example, Attachmate® Extra! for Windows) to communicate and control HostExplorer terminal emulators.
- DDE (Dynamic Data Exchange)—A tool that allows programs (for example, Microsoft Excel, Word, and Visual Basic) to communicate with the HostExplorer 3270 emulator.
While these APIs are less efficient and use larger and more rigid objects than COM and OHIO, you can still use them to write applications and thus avoid rewriting your own code. HostExplorer’s support of these earlier APIs helps maximize an organization’s investment in its development.