Xplore has four commands which are to be used with DLLs:
dlopenpens (loads) a DLL. Call the DLL named MyDLL with
h = dlopen("MyDLL")
or
h = dlopen("absolute_path_to_MyDLL")
In the first call, you need to have set the path to your DLL by
setenv
Or alternatively, you can set the environment variable XPL4DLL with
setenvo your DLL directory before starting XploRe.
The output from
dlopen
the scalar h, is the handle of the opened DLL.
Each time you open a DLL, this handle is incremented by 1. The handle is used to distinguish between
two opened DLLs with the same name.
dlcallalls functions from an already loaded DLL.
Call the function MyFunction with
dlcall("MyFunction", arg1, arg2, ...)
or
dlcall(h, "MyFunction", arg1, arg2, ...)
The second call applies, when you want to call explicitely the function MyFunction, which belongs to the DLL with handle h. You can omit the handle, if there is only one MyFunction in all the opened DLLs.
The arguments arg1, arg2, ... are the XploRe objects (scalars, vectors, matrices, arrays) which are to be passed to the function MyFunction.
dlqueryan be used to find out which DLLs are opened. It is invoked with
q = dlquery()
In case, that no DLL is open, it simply gives the value 0. In the case, that one or more DLLs are open,
dlqueryeturns a list with three components:
n | number of opened DLLs |
handle | handle of the DLL |
name | name of the DLL |
dlcloseloses (unloads) one or all DLLs. It is called by
dlclose("MyDLL")
or
dlclose(h)
or
dlclose()
The first and second call close a specified DLL by its name or by its handle, respectively. The last call will close all open DLLs.