About this task
Perform the following steps to use an implicitly loaded
DLL (sometimes called a load-on-call DLL) in your simple DLL application:
Procedure
- Write your code as you would if the functions were statically
bound.
- Compile as follows:
- Compile your non-XPLINK application C source files with the following
compiler options:
These options instruct the compiler to generate special code
when calling functions and referencing external variables. If you
are using z/OS® UNIX,
RENT and LONGNAME are already the defaults, so compile as:
c89 -W c,DLL ...
- Compile your C++ source files normally. A C++ application is always
DLL code.
- For XPLINK, compile your C and C++ source files with the XPLINK
compiler option. XPLINK compiled C and C++ source is always DLL code.
- Bind your object modules as follows:
Results
The following code fragment illustrates how an application
can use the DLL described previously. Compile normally and bind with
the definition side-deck provided
with the TRIANGLE DLL.
extern int getarea(); /* function prototype */
main () {
...
getarea(); /* imported function reference */
...
}
See Figure 1 for
a summary of the processing steps required for the application (and
related DLLs).