.dll files (which are built as native COBOL code) must be loaded into memory before they can be used. If you statically link a .dll file it is loaded automatically before your application is run. If you use dynamic linking, your program should load each .dll file as necessary before attempting to call entry points in it:
For example, if a file mydll.dll contains a single public entry point, the file is loaded and the call executed by a CALL "mydll" statement.
set mypointer to entry "mybigdll" call "My-third-entry-point"
You need to load a dynamic link library the first time you use it only, unless the .dll file is no longer in memory.
A .dll file is automatically removed from memory when a COBOL program within it is canceled and this results in all COBOL programs in the .dll file being either in an uncalled or a canceled state.
For example, consider a .dll file called sub.dll which contains three COBOL programs: sub.cbl, sub1.cbl and sub2.cbl.
The .dll file is not removed from memory because sub2.cbl has not yet been canceled.
The .dll file is removed, because all programs within it are now either canceled (sub.cbl and sub2.cbl) or not called (sub1.cbl).
The way you load OO .dll files depends on whether they contain a single class or several classes.