LabWindows/CVI

Content Type
Programming Language
Current manual

RunExternalModule

RunExternalModule

int RunExternalModule (int moduleID, const char buffer[]);

Purpose

Note Note  This class of functions is deprecated. National Instruments recommends that you instead use the Windows SDK functions LoadLibrary and GetProcAddress to load external modules. These functions allow you to load Windows DLLs, but not compiled object modules or libraries.

Calls the pre-defined entry point function in an external object module that was loaded using LoadExternalModule.

Note Note  This function is not supported for 64-bit applications.

RunExternalModule requires that the module define the following function:

void _xxx_entry_point (char [])

where xxx is the base name of the file, in lowercase. For example, if the pathname of the file is C:\LW\PROGRAMS\TEST01.OBJ, the name of the entry point must be _test01_entry_point.

Example Code

int module_id;
int status;
char *pathname;
pathname = "EXTMOD.OBJ";
module_id = LoadExternalModule (pathname);
if (module_id <0)

FmtOut ("Unable to load %s\n", pathname);

else {

RunExternalModule (module_id, "");
UnloadExternalModule (module_id);

}

Parameters

Input
Name Type Description
moduleID int The value returned by LoadExternalModule.
buffer const char [] A buffer used to pass information to and from the external module entry point function.

Return Value

Name Type Description
result int Indicates the result of the operation.

Code Description
0 Success.
-1 Out of memory.
-3 Entry point is undefined.
-4 Invalid file format.
-5 Undefined references.
-8 Cannot open file.
-9 Invalid module ID.
-25 DLL initialization failed, for example, DLL file not found.

Additional Information

Library: Utility Library

Include file: utility.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Was this information helpful?