Tao.Platform.Windows SDK Documentation |
|
Kernel.SetDllDirectory Method
The SetDllDirectory function modifies the search path used to locate DLLs for the application.
[Visual Basic]
Public Shared Function SetDllDirectory( _
ByVal
pathName As
String _
) As
Boolean
[C#]
public static
bool SetDllDirectory(
string pathName);
Parameters
-
pathName
- Pointer to a null-terminated string that specifies the directories to be added to the search path, separated by semicolons. If this parameter is NULL, the default search path is used.
Return Value
If the function succeeds, the return value is true.
If the function fails, the return value is false. To get extended error information, call GetLastWin32Error.
Remarks
The SetDllDirectory function affects all subsequent calls to the LoadLibrary and LoadLibraryEx functions. After calling SetDllDirectory, the DLL search path is:
-
The directory from which the application loaded.
-
The directory specified by the pathName parameter.
-
The system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is System32.
-
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System.
-
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
-
The directories that are listed in the PATH environment variable.
To revert to the default search path used by LoadLibrary and LoadLibraryEx, call SetDllDirectory with NULL.
See Also
Kernel Class | Tao.Platform.Windows Namespace | GetDllDirectory | GetSystemDirectory | GetWindowsDirectory | LoadLibrary