GetModuleDir
- Updated2023-02-21
- 2 minute(s) read
GetModuleDir
int GetModuleDir (const void *moduleHandle, char directoryPathname[]);
Purpose
Obtains the name of the directory of the specified DLL module.
You can use GetModuleDir if you distribute a DLL and its related files to multiple users who might place the files in different directories. If your DLL needs to access a file that is in the same directory as the DLL, you can use GetModuleDir and MakePathname to construct the full pathname.
If the moduleHandle you specify is zero, GetModuleDir returns the same result as GetProjectDir.
Parameters
Input | ||||
Name | Type | Description | ||
moduleHandle | const void * | Module handle of DLL. Use the default parameter, __CVIUserHInst, to specify the handle of the module that contains the call to GetModuleDir. You can use any valid Windows module handle. Use 0 to indicate the project or stand-alone executable (rather than a DLL). If you pass 0 for the moduleHandle, GetModuleDir obtains the directory of the executable. |
||
Output | ||||
Name | Type | Description | ||
directoryPathname | char [] | The buffer in which the module directory pathname is returned. directoryPathname must be at least MAX_PATHNAME_LEN bytes long.
|
Return Value
Name | Type | Description | ||||||||||||
result | int | The result of the call.
|
Additional Information
Library: Utility Library
Include file: utility.h
LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later