Loading a DLL explicitly

The use of DLLs can also be explicitly controlled by C/C++ application code at the source level. The application uses explicit source-level calls to one or more runtime services to connect the reference to the definition. The connections for the reference and the definition are made at runtime.

The DLL application writer can explicitly call the following C runtime services:
The following runtime services are also available as part of the Single UNIX Specification, Version 3:

While you can use both families of explicit DLL services in a single application, you cannot mix usage across those families. So a handle returned by dllload() can only be used with dllqueryfn(), dllqueryvar(), or dllfree(). And a handle returned by dlopen() can only be used with dlsym() and dlclose().

Since the dlopen() family of functions are part of the Single UNIX Specification, Version 3, they should be used in new applications if cross-platform portability is a concern.

For more information about the C runtime services, see z/OS XL C/C++ Runtime Library Reference.

To explicitly call a DLL in your application:

Explicit use of a DLL in a C application and Explicit use of a DLL in a COBOL/C application have examples of applications that use explicit DLL calls.