NativeLibrary.TryLoad Método

Definição

Sobrecargas

TryLoad(String, IntPtr)

Fornece uma API simples para carregar uma biblioteca nativa e retorna um valor que indica se a operação foi bem-sucedida.

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

Fornece uma API de alto nível que carrega uma biblioteca nativa e retorna um valor que indica se a operação foi bem-sucedida.

TryLoad(String, IntPtr)

Fornece uma API simples para carregar uma biblioteca nativa e retorna um valor que indica se a operação foi bem-sucedida.

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

Parâmetros

libraryPath
String

O nome da biblioteca nativa a ser carregada.

handle
IntPtr

nativeint

Quando o método é retornado, o identificador de SO da biblioteca nativa carregada.

Retornos

Boolean

true se a biblioteca nativa foi carregada com êxito; caso contrário, false.

Exceções

libraryPath é null.

Aplica-se a

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

Fornece uma API de alto nível que carrega uma biblioteca nativa e retorna um valor que indica se a operação foi bem-sucedida.

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

Parâmetros

libraryName
String

O nome da biblioteca nativa a ser carregada.

assembly
Assembly

O assembly que está carregando a biblioteca nativa.

searchPath
Nullable<DllImportSearchPath>

O caminho de pesquisa.

handle
IntPtr

nativeint

Quando o método é retornado, o identificador de SO da biblioteca nativa carregada.

Retornos

Boolean

true se a biblioteca nativa foi carregada com êxito; caso contrário, false.

Exceções

libraryPath ou assembly é null.

assembly não é um RuntimeAssembly.

Aplica-se a