Utility Library Chapter 8
LabWindows/CVI Standard Libraries 8-22 © National Instruments Corporation
Return Codes
0 Success.
-1 Out of memory.
-4 Invalid file format.
-5 Undefined references.
-8 Cannot open file.
-9 Invalid module ID.
-10 Identifier not defined globally in module.
-25 DLL initialization failed (e.g. DLL file not found).
Parameter Discussion
moduleID is the value LoadExternalModule returns.
name is the name of the identifier whose address is obtained from the external module. The
identifier must be a variable or function name defined globally in the external module.
status is zero if the function is a success, or a negative error code if it fails.
If GetExternalModuleAddr succeeds, it returns the address of the variable or function in
the module. If the function fails, it returns NULL.
Example
void (*funcPtr) (char buf[], double dval, int *ival);
int module_id;
int status;
char buf[100];
double dval;
int ival;
char *pathname;
char *funcname;
pathname = "EXTMOD.OBJ";
funcname = "my_function";
module_id = LoadExternalModule (pathname);
if (module_id < 0)
FmtOut ("Unable to load %s\n", pathname);
else {
funcPtr = GetExternalModuleAddr (module_id, funcname, &status);
if (funcPtr == NULL)
FmtOut ("Could not get address of %s\n", funcname);
else (*funcPtr) (buf, dval, &ival);
}