Platforms to show: All Mac Windows Linux Cross-Platform
Back to DeclareLibraryMBS class.
DeclareLibraryMBS.Constructor(LibFile as folderItem)
Function:
Loads a library.
Notes:
Pass path to DLL on Windows, dylib on MacOS or so file on Linux.
Raises exception in case of problems.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynamicDeclares | MBS Util Plugin | 20.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
Pass path to DLL on Windows, dylib on MacOS or so file on Linux.
Raises exception in case of problems.
See also:
DeclareLibraryMBS.Constructor(LibPath as string)
Function:
Loads a library.
Example:
Notes:
Pass path to DLL on Windows, dylib on MacOS or so file on Linux.
Raises exception in case of problems.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynamicDeclares | MBS Util Plugin | 20.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
// change path if you like to try this on Windows or Linux
Dim d As New DeclareLibraryMBS("/usr/lib/libz.1.dylib")
Dim lines() As String = d.SymbolNames
Break // look in list of functions
Pass path to DLL on Windows, dylib on MacOS or so file on Linux.
Raises exception in case of problems.
See also:
DeclareLibraryMBS.Symbol(name as string) as ptr
Function:
Queries function or data pointer for a symbol.
Example:
Notes:
Returns nil if not found.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynamicDeclares | MBS Util Plugin | 20.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
// change path if you like to try this on Windows or Linux
Dim d As New DeclareLibraryMBS("/usr/lib/libz.1.dylib")
// zlibVersion
// ZEXTERN Const char * ZEXPORT zlibVersion Of((void));
Dim p As ptr = d.Symbol("zlibVersion")
Dim f As New DeclareFunctionMBS("()Z", p)
Dim n As String = f.Invoke
MsgBox "zlibVersion: "+n
DeclareLibraryMBS.SymbolName(index as Integer) as string
Function:
Queries name of a symbol.
Notes: Index is in range from 0 to SymbolCount-1.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynamicDeclares | MBS Util Plugin | 20.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: Index is in range from 0 to SymbolCount-1.
See also:
DeclareLibraryMBS.SymbolName(p as Ptr) as string
Function:
Queries name of a symbol from the ptr.
Notes:
Looks up the symbol table to find the entry with the right pointer and returns the name.
Returns "" if not found.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynamicDeclares | MBS Util Plugin | 20.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes:
Looks up the symbol table to find the entry with the right pointer and returns the name.
Returns "" if not found.
See also:
DeclareLibraryMBS.SymbolNames as string()
Function:
Queries list of symbols of a library.
Example:
Notes:
This may show more symbols as defined in public C headers.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | DynamicDeclares | MBS Util Plugin | 20.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
// change path if you like to try this on Windows or Linux
Dim d As New DeclareLibraryMBS("/usr/lib/libz.1.dylib")
Dim lines() As String = d.SymbolNames
Break // look in list of functions
Some examples using this method:
The items on this page are in the following plugins: MBS Util Plugin.
