XploRe has five commands which are to be used with DLLs:
dlopen
opens (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
setenv
to 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.
dlcall
calls 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.
dlcallex
calls functions from an already loaded DLL.
Call the function
MyFunction
with
dlcallex("MyFunction", param, opt)
or
dlcallex(h, "MyFunction", param, opt)
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 argument param
contains the XploRe objects
(scalars, vectors, matrices, arrays) which are to be passed to the
function MyFunction. The parameter opt
tells how they
passed to the C/C++ function.
dlquery
can 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
case that one or more DLLs are open
dlquery
returns
a list with three components:
name
name of DLL
location
absolute path and name of the DLL
count
how many times the DLL is opened
dlclose
closes (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.