Progress
External Program
Interfaces


Shared Library Parameter Data Types

For shared library parameter definitions, Progress provides a special set of data types to match the standard C and Windows data types used in shared library calling sequences. These are the only data types you can specify for the AS datatype option in shared library parameter definitions:

CHARACTER and MEMPTR are standard Progress variable data types available for other uses. You can only use the remaining listed data types for shared library parameter definitions.

The MEMPTR data type specifies a pointer to a region of memory. It lets you define and pass C-compatible structures to shared library routines. It also provides a safe way to pass CHARACTER variables to shared library routines that modify them. For more information on using the MEMPTR data type, see the "Using Structure Parameters" section.

Data Type Compatibilities

For each parameter definition, you must specify a data type that is compatible with the standard C or Windows data type of the corresponding DLL routine parameter. Many data types referenced by DLL routines have the same memory size and usage.

Table 5–2 lists each supported memory size and usage, examples of corresponding C and Windows data types, and the Progress DLL parameter data type you must use for each one.

Table 5–2: C and DLL Parameter Data Type Compatibilities

Data Type Size and Usage
Example C and
Windows Data Types
DLL Parameter
Data Type
8-bit unsigned integer
char, BYTE 
BYTE
16-bit signed integer
short, ATOM, BOOL 
SHORT
16-bit unsigned integer
unsigned short 
UNSIGNED- SHORT
32-bit signed integer
long, COLORREF, int1 
LONG
4-byte floating point
float 
FLOAT
8-byte floating point
double 
DOUBLE
Address (usually 32 bits)
char* 
CHARACTER
Address (usually 32 bits)
double* 
HANDLE TO DOUBLE2
Address (usually 32 bits)
char*, LPCSTR, LPWINDOWPOS 
MEMPTR
  1. The C data type int generally specifies a size that depends on the operating system.
  2. You can also use the HANDLE option to specify pointers to FLOAT, LONG, SHORT, and BYTE data types. For a CHARACTER parameter, it is redundant because this data type is always passed using a pointer (char*).

For more information on C and Windows data types, see the documentation for the operating system(s) on which your applications will run.

Other Data Type Options

For shared library parameters that pass pointers to scalar values (for example, SHORT, DOUBLE, etc.), Progress provides the HANDLE option. You must use this option for INPUT parameters that require pointers to scalar values instead of the values themselves. Although Progress automatically passes pointers for OUTPUT and INPUT-OUTPUT parameters, the HANDLE option is recommended for clarity.

If you use the LIKE option to specify the data type of a parameter definition, field might only be a database field defined as CHARACTER or a Progress variable defined as CHARACTER or MEMPTR.

NOTE: Progress does not support database fields defined as MEMPTR.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095