Introduction to Emulator APIs

The IBM® Personal Communications product supplies several application programming interfaces (APIs). Each interface has a specific set of functions and may be used for different purposes. Choose the programming interface that best matches the functional requirements of your application. Some applications may use more than one interface to achieve the desired results. The programming interfaces are:

Using API Header Files

The application program should include operating system header files before including API header files. For example:

  #include <windows.h>      // Windows main header
  #include "pcsapi.h"       // PComm PCSAPI header
  ...

Critical Sections

Use critical sections (EnterCriticalSection function) carefully when your program calls emulator APIs. Do not make emulator API calls within a critical section. If one thread of an application establishes a critical section and another thread is within an emulator API call, the call is suspended until you exit from the critical section.

During processing of an API call, all signals (except numeric coprocessor signals) are delayed until the call completes or until the call needs to wait for incoming data. Also, TerminateProcess issued from another process is held until the application completes an API call it might be processing.

Stack Size

Emulator APIs use the calling program's stack when they are executed. The operating system, the application, and the API all require stack space for dynamic variables and function parameters. At least 8196 bytes (8K) of stack space should be available at the time of an API call. It is the responsibility of the application program to ensure sufficient stack space is available for the API.

Running 16-bit Windows EHLLAPI programs

If you are running multiple 16-bit Windows EHLLAPI tasks that use any of the 16-bit EHLLAPI DLLs, each 16-bit EHLLAPI task must run under a separate NTVDM. You can use any of the following methods to accomplish this:

Windows x64 Platform Support

The x64-based versions of Microsoft Windows Server 2008 and Microsoft Windows 8/8.1/10 x64 Edition are optimized to run native 64-bit programs, but do not support 32-bit drivers or 16-bit applications.

For these platforms, Personal Communications does not install the following libraries.

Sample Programs

Several sample programs are provided, each of which illustrates the use of one of the Personal Communications APIs. If you choose to install the sample programs, they will be installed in the \SAMPLES directory.

Note:
International Business Machines Corporation provides these files as is, without warranty of any kind, either express or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose.

The sample program files include source and supporting files for the following Personal Communications APIs:

The following files are installed in the \SAMPLES directory.

Table 1. Sample Program Files
File Name Description
DDE_C.H DDE include file
EHLAPI32.H IBM standard 32-bit EHLLAPI include file
WHLLAPI.H WinHLLAPI 16-bit include file
HAPI_C.H EHLLAPI include file
PCSAPI.H PCSAPI include file
PCSCALLS.LIB Import library for standard interface
PCSCAL32.LIB Import library for enhanced interface
EHLAPI32.LIB Import library for IBM Standard 32-bit EHLLAPI interface
WHLLAPI.LIB Import library for WinHLLAPI 16-bit interface
WHLAPI32.LIB Import library for WinHLLAPI 32-bit interface
UUCCPRB.H SRPI include file

The following subdirectories are created in the \SAMPLES directory.

Table 2. Sample Program Subdirectories
File Name Description
DDXFER Shows how EHLLAPI can be used to create a "Drag and Drop" application; in this case, for file transfer
ECL HACL sample files
HLLSMP Shows how to use EHLLAPI to request a keystroke and log on to a VM system
LISTFILE Illustrates how DDE can make use of the LOAD button to transfer files from the host
PCSMAIN Illustrates the use of PCSAPI to start and stop sessions, query the session status, and query the profile for the session
SPL2FILE A program that uses DDE to save an iSeries®, eServer™ i5, or System i5® spool file as an ASCII file on the PC
SRPSMP Illustrates the use of the Server Requester Programming Interface (SRPI)
VBDDE VBDDE sample files
VBHLLAPI VBHLLAPI sample files
VBPCSAPI VBPCSAPI sample files

Displaying Arabic data in the VBHLLAPI sample program

For proper display of Arabic data in the VBHLLAPI sample program, you should do the following:

  1. Edit the VBHLLAPI sample program source code. For each form, change the default font property to a Windows True Type font that supports Arabic script (for example, Courier New).
  2. Recompile the VBHLLAPI sample program.