Utility Library Chapter 8
LabWindows/CVI Standard Libraries 8-32 © National Instruments Corporation
Purpose
This function obtains the name of the directory of the specified DLL module.
This function is useful when a DLL and its related files are distributed to multiple users who may
place them in different directories. If your DLL needs to access a file that is in the same directory
as the DLL, you can use the GetModuleDir and MakePathname functions to construct the
full pathname.
If the specified module handle is zero, then this function returns the same result as
GetProjectDir.
Parameter List
Output directoryPathname string Directory of module.
Input moduleHandle void
pointer Module handle of DLL, or zero for the
project.
Parameter Discussion
directoryPathname must be at least MAX_PATHNAME_LEN bytes long.
If you want to obtain the directory name of the DLL in which the call to GetModuleDir
resides, then pass __CVIUserHInst as the moduleHandle. You can pass any valid Windows
module handle. If you pass 0 for the moduleHandle, this function obtains the directory of the
project or standalone executable.
Return Value
result integer Result of the operation.
Return Codes
0 Success.
-1 The current project has no pathname (that is, it is untitled).
-2 There is no current project.
-3 Out of memory.
-4 The operating system is unable to determine the module directory (moduleHandle is
probably invalid).