Using DLL linkage and dynamic calls together
For applications (that is, Language Environment® enclaves) that are structured
as multiple separately bound modules, each module
can be invoked by using dynamic call linkage or DLL linkage. For a
certain module, use exclusively one form of linkage to enter it. However,
the caller can contain CALL
statements with both
linkage types, calling out to different modules.
DLL linkage refers to a call
in a program that is compiled with the DLL
and NODYNAM
options,
or a call with the CALLINTERFACE
compiler directive
that specifies DLL. In such calls, the called subprogram is resolved
to an exported name in a separate module. DLL linkage can also refer
to an invocation of a method that is defined in a separate module.
Within a compilation unit you can call a specific program with only one of the calling conventions: Dynamic, DLL or Static. If a program is called by using different calling conventions, the compiler diagnoses this case and force all the calls to have the same convention as the first call statement that is encountered for that program.
A program can contain CALL
statements
with both dynamic call linkage and DLL linkage. It can do so by using
the CALLINTERFACE compiler directive to specify the linkage type of
a particular call. All components of a DLL application must have
the same AMODE. The automatic AMODE switching normally provided by
COBOL dynamic calls is not available for DLL linkages. You
cannot cancel programs that are called by using DLL linkage.
All components of a DLL application must have the same AMODE. The automatic AMODE switching normally provided by COBOL dynamic calls is not available for DLL linkages.