UnloadExternalModule
- Updated2023-02-21
- 2 minute(s) read
UnloadExternalModule
int UnloadExternalModule (int moduleID);
Purpose
![]() |
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. |
Invalidates a module ID obtained from LoadExternalModule.
![]() |
Note This function is not supported for 64-bit applications. |
After UnloadExternalModule is called, you cannot access the module through GetExternalModuleAddr or RunExternalModule.
If the module file is not in the project and not loaded as an instrument module, UnloadExternalModule removes the external module file from memory.
Use ReleaseExternalModule instead of UnloadExternalModule when multiple calls might have been made to LoadExternalModule on the same module and you do not want to unload the module in case other parts of the application still use it.
Example Code
int module_id;
int status;
char *pathname;
pathname = "PROG.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 that LoadExternalModule returns, or -1. If moduleID is -1, LabWindows/CVI unloads all external modules. |
Return Value
Name | Type | Description | ||||||||
result | int | The result of the operation.
|
Additional Information
Library: Utility Library
Include file: utility.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later