MMCC MASTHEAD

PL/B INDEX

Main PL/B Page

Mid-Michigan Computer Consultants
509 Center - Bay City, Michigan
Sales (989) 892-9242             Support (989) 686-8860

ANSI Standard PL/B Language
Windows API Calls

High level languages such as PL/B provide the majority of functions that a programmer might need. But they don't do everything that is possible in a particular environment such as Windows.

The Windows API (Application Program Interface) call allows a programmer access to all the features and routines within Windows itself.

API DOCUMENTATION

Finding documentation to the Windows API can be a challenge. Most of the resources are aimed at the Visual BASIC or the "C" programmer. The PL/B API calls are very similar to those languages, but they are not exactly the same. You'll have to do some translation which means understanding the other languages. Visual BASIC resources seem to be the easiest to work with.

There are a number of web sites that contain good API information. Sunbelt has documented several of the most useful API calls and included the information in the code unit "PROFILE.INC" which is found in the "DEMO" folder that is created when you install the PLBWIN system.

NOTES

Before using an API you must define the thing with PL/B's PROFILE statement. This is the same as "declaring" the API in VB. For example:
Visual Basic:
Declare Function FindFirstFile Lib "kernel32.dll" _
       Alias "FindFirstFileA" _
       (ByVal lpFileName As String, _
       lpFindFileData As WIN32_FIND_DATA) As Long

PL/B:
FindFirst PROFILE  kernel32:  ;DLL name
       FindFirstFileA:   ;API name
       INT4:             ;File Handle return value
       DIM:              ;Search File Name
       DIM               ;FileData structure
To actually USE the PL/B profile you'd code:
   WINAPI  FindFirst GIVING FHANDLE USING NAME,FileData


Visual BASIC Notes

Data can be typed by designating as long or something like as string. The types of interest are MORE TO COME
Send e-mail to MMCC.

Write to MMCC Technical Support at:
MMCC, Inc.
600 W. Midland
Bay City, MI 48708
(989) 686-8860
Home
© 2001 MMCC, Inc. All Rights Reserved.
Report problems or suggestions to support@mmcctech.com