Consultor Eletrônico



Kbase 13532: Problems with DLLs running several times and then failing
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Problems with DLLs running several times and then failing

If a DLL function is running successfully once and
then failing the problem is often resolved by loading
the DLL library before accessing it and unloading it when you have
finished. To do this use the following external procedures:

DEF VAR hlib AS INTEGER NO-UNDO.

PROCEDURE LOADLIBRARY EXTERNAL "KRNL386.EXE":
DEFINE INPUT PARAMETER m-filename AS CHARACTER.
DEFINE RETURN PARAMETER hlib AS SHORT.
END.

PROCEDURE FREELIBRARY EXTERNAL "KRNL386.EXE":
DEFINE INPUT PARAMETER m-return AS SHORT.
END.

RUN LOADLIBRARY("lib.dll", OUTPUT hlib)


After you have finished using the DLL, run:

RUN FREELIBRARY(hlib).


NOTE:
When implementing this in Windows NT you will need to use
LoadLibraryA and "KERNEL32.DLL".

Progress Software Technical Support Note # 13532