High Level Language Application Programming Interface, commonly referred to as HLLAPI, is an industry standard method for a Windows application to interface with a host system using a standard terminal emulation program, such as FlexSoftware's Flex Terminal Emulator. HLLAPI applications are typically developed to provide users a more user friendly interface to host applications and can also be used to automate routine and/or repetitive tasks.


Compatibility

Flex Terminal Emulator supports the Windows HLLAPI Specification Version 1.1 and is compatible with the HLLAPI support found in many common terminal emulators, such as IBM Personal Communications® and Attachmate EXTRA!®.


Configuration

HLLAPI is available in any Flex Terminal Emulator session and, by default, each successfully connected Flex Terminal Emulator session is automatically assigned an alphabetic character, ranging sequentially from A through Z. This is referred to as the HLLAPI Short Name. For HLLAPI applications that require a particular HLLAPI Short Name, Flex Terminal Emulator may be configured to use a specifically assigned Short Name.


Invoking the HLLAPI Functions

Flex Terminal Emulator HLLAPI supports both .NET applications and traditional Win32 applications. In order to facilitate that, three versions of HLLAPI DLLs are included with the installation and are found in the Hllapi sub-folder within the Flex Terminal Emulator install folder, for example C:\Program Files\FlexSoftware\FlexTerm\Hllapi\.


Use one of the following by referencing it from the installed location, or copy to the install folder of the HLLAPI application:


  • Flex.Hllapi.dll
    Built with platform “Any CPU” targeted for .NET applications only.

  • Flex.Hllapi32.dll
    Contains dual interfaces (one for .NET applications and one for standard 32-bit Win32 applications) targeted for x86 applications.

  • Flex.Hllapi64.dll
    Contains dual interfaces (one for .NET applications and one for standard 64-bit Win32 applications) targeted for x64 applications.


Note: if the HLLAPI application requires a particular DLL name, after copying one of the above to the application's install folder, simply rename it accordingly. For example, many HLLAPI applications are hard coded to use HLLAPI32.DLL.

The entry point function is hllapi.


hllapi signature (c/c++):


void WINAPI hllapi(LPWORD, LPBYTE, LPWORD, LPWORD);


LPWORD HllFunc /* Function name */

LPBYTE HllDataStr /* String pointer */

LPWORD HllDataLen /* String (data) length */

LPWORD PsPosRetCode /* Return code */


Example to make a call using c/c++:


WORD HllFunc = 1;

char HllDatStr[1];

HllDataStr[0] = 'A'; /* Short name of session to connect */

WORD HllDataLen = 1;

WORD PsPosRetCode;


hllapi(&HllFunc, HllDataStr, &HllDataLen, &PsPosRetCode);


hllapi signature (c#):


void hllapi(ref UInt16 HllFunc, byte[] HllDataStr, ref UInt16 HllDataLen, ref UInt16

PsPosRetCode)


ref UInt16 HllFunc /* Function number */

byte[] HllDataStr /* String pointer */

ref UInt16 HllDataLen /* String (data) length */

ref UInt16 PsPosRetCode /* Return code */


Example to make a call using c#


using Flex.Hllapi; // Import namespace first


UInt16 HllFunc = FUNCTIONCODE.CONNECTPS; // Function number

byte[] HllDataStr = new byte[] { Convert.ToByte('A') }; // short name A

UInt16 HllDataLen = 1;

UInt16 PsPosRetCode = 0;


HllapiCSharp.hllapi(ref HllFunc, HllDataStr, ref HllDataLen, ref PsPosRetCode);