18.11 XploRe commands for using DLLs

XploRe has five commands which are to be used with DLLs:


18.11.1 dlopen

42474 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 42477 setenv . Or alternatively you can set the environment variable XPL4DLL with 42480 setenv to your DLL directory before starting XploRe.


The output from 42483 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.


18.11.2 dlcall

42525 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.


18.11.3 dlcallex

42555 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.


18.11.4 dlquery

42585 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 42588 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


18.11.5 dlclose

42620 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.