NativeLibrary.TryLoad Méthode

Définition

Surcharges

TryLoad(String, IntPtr)

Fournit une API simple pour le chargement d’une bibliothèque native et retourne une valeur qui indique si l’opération a réussi.

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

Fournit une API de haut niveau qui charge une bibliothèque native et retourne une valeur qui indique si l’opération a réussi.

TryLoad(String, IntPtr)

Source:
NativeLibrary.cs
Source:
NativeLibrary.cs
Source:
NativeLibrary.cs

Fournit une API simple pour le chargement d’une bibliothèque native et retourne une valeur qui indique si l’opération a réussi.

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

Paramètres

libraryPath
String

Nom de la bibliothèque native à charger.

handle
IntPtr

nativeint

Quand la méthode est retournée, descripteur de système d’exploitation de la bibliothèque native chargée.

Retours

true si la bibliothèque native a été correctement chargée ; sinon, false.

Exceptions

libraryPath a la valeur null.

S’applique à

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

Source:
NativeLibrary.cs
Source:
NativeLibrary.cs
Source:
NativeLibrary.cs

Fournit une API de haut niveau qui charge une bibliothèque native et retourne une valeur qui indique si l’opération a réussi.

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

Paramètres

libraryName
String

Nom de la bibliothèque native à charger.

assembly
Assembly

Assembly chargeant la bibliothèque native.

searchPath
Nullable<DllImportSearchPath>

Chemin de recherche.

handle
IntPtr

nativeint

Quand la méthode est retournée, descripteur de système d’exploitation de la bibliothèque native chargée.

Retours

true si la bibliothèque native a été correctement chargée ; sinon, false.

Exceptions

libraryPath ou assembly est null.

assembly n’est pas un RuntimeAssembly.

S’applique à