Method TryLoad
- Namespace
- Ubiquity.NET.InteropHelpers
- Assembly
- Ubiquity.NET.InteropHelpers.dll
TryLoad(string, out NativeLibraryHandle)
Provides a simple API for loading a native library and returns a value that indicates whether the operation succeeded.
public static bool TryLoad(string libraryPath, out NativeLibraryHandle lib)
Parameters
libraryPathstringThe name of the native library to be loaded.
libNativeLibraryHandleNative library handle.
Returns
Exceptions
- ArgumentNullException
libraryPathis null.
TryLoad(string, Assembly, DllImportSearchPath?, out NativeLibraryHandle)
Provides a high-level API that loads a native library and returns a value that indicates whether the operation succeeded.
public static bool TryLoad(string libraryName, Assembly assembly, DllImportSearchPath? searchPath, out NativeLibraryHandle lib)
Parameters
libraryNamestringThe name of the native library to be loaded.
assemblyAssemblyThe assembly loading the native library.
searchPathDllImportSearchPath?The search path.
libNativeLibraryHandleNative library Handle
Returns
Exceptions
- ArgumentNullException
libraryPathorassemblyis null.- ArgumentException
assemblyis not aRuntimeAssembly.