National Instruments 320682C Musical Toy Instrument User Manual


 
Utility Library Chapter 8
LabWindows/CVI Standard Libraries 8-52 © National Instruments Corporation
3. If the file has not been found and its extension is .dll, LoadExternalModule searches
for the file in the directories specified in the Windows LoadLibrary call.
If it is a relative pathname with one or more directory paths (such as dir\module.obj),
LoadExternalModule creates an absolute pathname by appending the relative pathname to
the directory that contains the currently loaded project.
If the pathname is for a DLL import library, LoadExternalModule finds the DLL using the
DLL name embedded in the import library and the standard Windows DLL search algorithm.
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);
}
LoadExternalModuleEx
int moduleId = LoadExternalModuleEx (char pathName[],
void *callingModuleHandle);
Purpose
LoadExternalModuleEx loads a file containing one or more object modules. It is similar to
LoadExternalModule, except that, on Windows 95 and NT, external references in object
and library modules loaded from a DLL can be resolved using DLL symbols that are not
exported. On platforms other than Windows 95 and NT, LoadExternalModuleEx works
exactly like LoadExternalModule.