Freigeben über


NativeLibrary.TryLoad Methode

Definition

Überlädt

TryLoad(String, IntPtr)

Bietet eine einfache API zum Laden einer nativen Bibliothek und gibt einen Wert zurück, der angibt, ob der Vorgang erfolgreich war.

TryLoad(String, Assembly, Nullable<DllImportSearchPath>, IntPtr)

Bietet eine API auf höchster Stufe zum Laden einer nativen Bibliothek und gibt einen Wert zurück, der angibt, ob der Vorgang erfolgreich war.

TryLoad(String, IntPtr)

Quelle:
NativeLibrary.cs
Quelle:
NativeLibrary.cs
Quelle:
NativeLibrary.cs

Bietet eine einfache API zum Laden einer nativen Bibliothek und gibt einen Wert zurück, der angibt, ob der Vorgang erfolgreich war.

public:
 static bool TryLoad(System::String ^ libraryPath, [Runtime::InteropServices::Out] IntPtr % handle);
public static bool TryLoad (string libraryPath, out IntPtr handle);
static member TryLoad : string * nativeint -> bool
Public Shared Function TryLoad (libraryPath As String, ByRef handle As IntPtr) As Boolean

Parameter

libraryPath
String

Der Name der zu ladenden nativen Bibliothek.

handle
IntPtr

nativeint

Das Betriebssystemhandle der geladenen nativen Bibliothek bei Rückgabe der Methode.

Gibt zurück

true , wenn die native Bibliothek erfolgreich geladen wurde; falseandernfalls .

Ausnahmen

libraryPath ist null.

Gilt für:

TryLoad(String, Assembly, Nullable<DllImportSearchPath>, IntPtr)

Quelle:
NativeLibrary.cs
Quelle:
NativeLibrary.cs
Quelle:
NativeLibrary.cs

Bietet eine API auf höchster Stufe zum Laden einer nativen Bibliothek und gibt einen Wert zurück, der angibt, ob der Vorgang erfolgreich war.

public:
 static bool TryLoad(System::String ^ libraryName, System::Reflection::Assembly ^ assembly, Nullable<System::Runtime::InteropServices::DllImportSearchPath> searchPath, [Runtime::InteropServices::Out] IntPtr % handle);
public static bool TryLoad (string libraryName, System.Reflection.Assembly assembly, System.Runtime.InteropServices.DllImportSearchPath? searchPath, out IntPtr handle);
static member TryLoad : string * System.Reflection.Assembly * Nullable<System.Runtime.InteropServices.DllImportSearchPath> * nativeint -> bool
Public Shared Function TryLoad (libraryName As String, assembly As Assembly, searchPath As Nullable(Of DllImportSearchPath), ByRef handle As IntPtr) As Boolean

Parameter

libraryName
String

Der Name der zu ladenden nativen Bibliothek.

assembly
Assembly

Die Assembly, die die native Bibliothek lädt.

searchPath
Nullable<DllImportSearchPath>

Der Suchpfad.

handle
IntPtr

nativeint

Das Betriebssystemhandle der geladenen nativen Bibliothek bei Rückgabe der Methode.

Gibt zurück

true , wenn die native Bibliothek erfolgreich geladen wurde; falseandernfalls .

Ausnahmen

libraryPath oder assembly ist null.

assembly ist keine RuntimeAssembly.

Gilt für: