LabWindows/CVI Real-Time Module

LoadRTModule

  • Updated2023-02-21
  • 1 minute(s) read

int LoadRTModule (const char pathname[], int *moduleID);

Purpose

Loads a DLL module.

This function will also try to load any statically linked dependencies of the specified module. If any of the dependencies cannot be found or loaded, then the specified DLL will fail to load.

After you load a module you can access symbols in that module by calling GetRTModuleAddr.

Each module loaded by this function is reference counted. The reference count increases each time you call LoadRTModule and decreases each time you call UnloadRTModule. When the reference count reaches zero the module is unloaded.

RT This function is supported only on RT systems.

Parameters

Input
Name Type Description
pathname const char [] The relative or absolute pathname of the DLL module to load.

If pathname is a simple filename or relative path, then LoadRTModule will search the system path to locate the file.
Output
Name Type Description
moduleID int The ID of the loaded module. If this function returns an error the module ID will be set to zero. Zero is not a valid module ID.

You can pass this value to GetRTModuleAddr and UnloadRTModule.

When you are done using the module, call UnloadRTModule.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. Unless otherwise stated, zero indicates successful execution and a negative number indicates that an error occurred.

You can call the GetRTUtilErrorString function to obtain a message that describes the error.

Additional Information

Library: Real-Time Utility Library

Include file: rtutil.h

LabWindows/CVI compatibility: LabWindows/CVI 9.0 and later