nuget server logo nuget api documents
↑

API Docs / Microsoft.VisualBasic.Runtime / IDynamicLibraryLoader

IDynamicLibraryLoader

Full name Microsoft.VisualBasic.ApplicationServices.DynamicInterop.IDynamicLibraryLoader Assembly Microsoft.VisualBasic.Runtime Members 4

An interface definition to hide the platform specific aspects of library loading

00 Remarks

There are probably projects 'out there' doing this already, but nothing is obvious from a quick search. Re-consider again if you need more features.

01 Syntax

Microsoft.VisualBasic.ApplicationServices.DynamicInterop.IDynamicLibraryLoader

02 Methods

NameOverloadsSummary
LoadLibrary 1 Load a native library (DLL on windows, shared libraries on Linux and MacOS)
GetLastError 1 Gets the last error message from the native API used to load the library.
FreeLibrary 1 Unloads a library
GetFunctionAddress 1 Gets a pointer to the address of a native function in the specified loaded library

03 Members

method LoadLibrary #
LoadLibrary(String)

Load a native library (DLL on windows, shared libraries on Linux and MacOS)

Parameters
NameTypeDescription
filenameString

The file name (short file name) of the library to load, e.g. R.dll on Windows

method GetLastError #
GetLastError

Gets the last error message from the native API used to load the library.

method FreeLibrary #
FreeLibrary(IntPtr)

Unloads a library

Parameters
NameTypeDescription
handleIntPtr

The pointer to the entry point of the library

method GetFunctionAddress #
GetFunctionAddress(IntPtr, String)

Gets a pointer to the address of a native function in the specified loaded library

Remarks

GetProcAddress

Parameters
NameTypeDescription
hModuleIntPtr

Handle of the module(library)

lpProcNameString

The name of the function sought

Returns

Handle to the native function