Release 10.1A: OpenEdge Development:
Programming Interfaces

> ## Options for shared library routine declarations

> In the syntax, the `proc-name` value is the name of your shared library routine. The `EXTERNAL` option indicates that the procedure being declared is an internal procedure implemented by an external shared library routine. The `dllname` value is the name of the shared library file that contains the routine.

> If you specify the `PERSISTENT` option, the entire shared library remains loaded until Progress exits, or until you explicitly unload the shared library by using the 4GL `RELEASE EXTERNAL` statement.

> Each `parameter-definition` value consists of a `DEFINE PARAMETER` statement. This is the syntax you must use for the `DEFINE` `PARAMETER` statement in a DLL routine declaration:

> Syntax
>     DEFINE { INPUT | OUTPUT | INPUT-OUTPUT | RETURN }
>       PARAMETER parameter
>       { { LIKE field } | { AS [ HANDLE TO ] datatype } }

> Each `DEFINE` `PARAMETER` statement specifies an `INPUT`, `OUTPUT`, or `INPUT-OUTPUT` parameter in the order it appears in the calling sequence of your shared library routine. You can also (optionally) define one `RETURN` parameter that provides the function return value of your shared library routine.

> The parameter name (`parameter`) serves only as a place holder, and can take any unique identifier value. The `AS` `datatype` and `LIKE` `field` options require a special set of data types for shared library parameter definitions. These are described in the following section.

> ##### Windows DLL calling conventions

> The `PROCEDURE` statement lets you specify the calling convention — C, Pascal, or standard—that your DLL requires. The default is the standard calling convention. Many Windows functions use the standard calling convention. Windows functions that take a variable number of arguments, such as `wsprintf()`, often use the C calling convention. For more information on the C, Pascal, and standard calling conventions, see the Microsoft C Language Reference . For more information on the calling convention that a particular Windows function requires, see the Microsoft Windows Programmer’s Reference . Table 12–1 shows how to specify calling conventions.

> Table 12–1: DLL calling conventions
> To specify this calling convention... | Code this option...
> --- | ---
> C | C
> Pascal | PASCAL
> Standard | STDCALL

> You can alternatively specify the DLL entry point by number with the `ORDINAL` `n` option, where `n` is the ordinal number of the entry point in the library. If you specify the entry point by number, `proc-name` can have any unreserved identifier value, but you must use the same value for the `RUN` statement that executes the DLL routine.

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