NativeLibrary.Load NativeLibrary.Load NativeLibrary.Load NativeLibrary.Load Method

Definition

Overloads

Load(String) Load(String) Load(String) Load(String)

Provides a simple API for loading a native library that wraps the OS loader and uses default flags.

Load(String, Assembly, Nullable<DllImportSearchPath>) Load(String, Assembly, Nullable<DllImportSearchPath>) Load(String, Assembly, Nullable<DllImportSearchPath>)

Provides a high-level API for loading a native library.

Load(String) Load(String) Load(String) Load(String)

Provides a simple API for loading a native library that wraps the OS loader and uses default flags.

public:
 static IntPtr Load(System::String ^ libraryPath);
public static IntPtr Load (string libraryPath);
static member Load : string -> nativeint
Public Shared Function Load (libraryPath As String) As IntPtr

Parameters

libraryPath
String String String String

The name of the native library to be loaded.

Returns

The handle for the loaded native library.

Exceptions

Load(String, Assembly, Nullable<DllImportSearchPath>) Load(String, Assembly, Nullable<DllImportSearchPath>) Load(String, Assembly, Nullable<DllImportSearchPath>)

Provides a high-level API for loading a native library.

public:
 static IntPtr Load(System::String ^ libraryName, System::Reflection::Assembly ^ assembly, Nullable<System::Runtime::InteropServices::DllImportSearchPath> searchPath);
public static IntPtr Load (string libraryName, System.Reflection.Assembly assembly, Nullable<System.Runtime.InteropServices.DllImportSearchPath> searchPath);
static member Load : string * System.Reflection.Assembly * Nullable<System.Runtime.InteropServices.DllImportSearchPath> -> nativeint

Parameters

libraryName
String String String String

The name of the native library to be loaded.

assembly
Assembly Assembly Assembly Assembly

The assembly loading the native library.

searchPath
Nullable<DllImportSearchPath>

The search path.

Returns

The handle for the loaded library.

Exceptions

Remarks

Given a library name, this method searches specific paths based on the runtime configuration, input parameters, and attributes of the calling assembly. If the searchPath parameter is non-null, the flags in this enumeration are used. Otherwise, the flags specified by the DefaultDllImportSearchPathsAttribute on the calling assembly, if any are present, are used. This method does not invoke the following managed callbacks for native library resolution:

Applies to