Problem:
When a DLL is loaded with SET PROCEDURE-POINTER, the DLL is in use. Therefore, it is not possible to delete or replace the DLL. It only gets released once the program stops running.
Resolution:
Use the CANCEL statement to cancel each entry point or function that have been called in the DLL before cancelling the DLL itself. Cancelling the DLL only will not release the DLL. See the example below:
SET mypointer TO ENTRY "mydll"
*> mydll is in use
CALL callconvention "myfunction1" using parm1, parm2, ...
CALL callconvention "myfunction2" using parm3, parm4, ...
...
CANCEL "myfunction1"
CANCEL "myfunction2"
CANCEL "mydll"
*> from this point, it is possible to delete or replace mydll
...