Kernel32AddDllDirectory Method
Adds a directory to the process DLL search path.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true,
SetLastError = true)]
public static IntPtr AddDllDirectory(
string newDirectory
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Unicode, ExactSpelling := true,
SetLastError := true>]
Public Shared Function AddDllDirectory (
newDirectory As String
) As IntPtr
Dim newDirectory As String
Dim returnValue As IntPtr
returnValue = Kernel32.AddDllDirectory(newDirectory)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Unicode, ExactSpelling = true,
SetLastError = true)]
static IntPtr AddDllDirectory(
String^ newDirectory
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true,
SetLastError = true)>]
static member AddDllDirectory :
newDirectory : string -> IntPtr
No code example is currently available or this language may not be supported.
- newDirectory String
-
An absolute path to the directory to add to the search path.
For example, to add the directory Dir2 to the process DLL search path, specify \Dir2.
IntPtr
If the function succeeds, the return value is an opaque pointer that can be passed to
RemoveDllDirectory(IntPtr) to remove the DLL from the process DLL search path.
If the function fails, the return value is
Zero.
To get extended error information, call
GetLastWin32Error.