Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C Library | both |
#include <dll.h>
void (*dllqueryfn(dllhandle *dllHandle, const char *funcName))();
Obtains a pointer to a dynamic link library (DLL) function (funcName). It uses the dllHandle returned from a previous successful call to dllload() for input. funcName represents the name of an exported function from the DLL. It must be a character string terminated with the NULL character.
This function is not available under the SPC, MTF, and CSP environments.
If successful, dllqueryfn() returns a pointer to a function, funcName, that can be used to invoke the desired function in a DLL.
If unsuccessful, dllqueryfn() returns NULL and sets errno.
⁄* CELEBDL2
The following example shows how to use dllqueryfn() to obtain
a pointer to a function, f1 that is in DLL load module stream.
*⁄
#include <stdio.h>
#include <dll.h>
main() {
dllhandle *handle;
char *name="stream";
int (*fptr1)();
handle = dllload(name);
if (handle == NULL) {
perror("failed on dllload of stream DLL");
exit(-1);
}
fptr1 = (int (*)()) dllqueryfn(handle,"f1");
if (fptr1 == NULL) {
perror("failed on retrieving f1 function");
exit (-2);
}
}