Platforms to show: All Mac Windows Linux Cross-Platform
Back to SoftDeclareMBS class.
SoftDeclareMBS.CallFunction(param as string,data as memoryblock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 7.7 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The param string is a combination of the characters "i" for integer, "l" for 64bit integer, "f" for single (float) and "d" for double.
Use "i" for booleans, shorts and pointers.
the memoryblock must match exactly the parameters you specified.
Returns true on success.
See also:
SoftDeclareMBS.CallFunction(paramcount as Integer,data as memoryblock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If paramtercount is 0, the memoryblock is ignored.
The size of the memoryblock must be minimum 4*paramcount.
Each parameter is set using m.long(n*4) where n=0 is the first parameter.
A parameter may be any integer value or an address of a memoryblock. The address can be read using memoryblock.addressMBS which is part of the plugin. You can even use only one memoryblock for all 3 parameters in the example like this:
m=newmemoryBlock(2100)
m.cstring(1024)=path
m.long(0)=m.address(20)
m.long(4)=m.address(1024)
m.long(8)=1024
First 12 bytes for the parameter table, the next 1000 bytes for the result buffer and finally a thousand bytes for the input string.
Before RB 3.1 this function was named "Call", but RB5 requires that the word "Call" is no longer valid for a function name.
Softdeclare is limited to only 6 parameters for plugin version 3.2. Plugin version 3.3 extends this to 8 parameters.
See also:
SoftDeclareMBS.CallFunctionDouble(param as string,data as memoryblock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 7.7 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The param string is a combination of the characters "i" for integer, "l" for 64bit integer, "f" for single (float) and "d" for double.
Use "i" for booleans, shorts and pointers.
the memoryblock must match exactly the parameters you specified.
Returns true on success.
See also:
Some examples using this method:
SoftDeclareMBS.CallFunctionDouble(paramcount as Integer,data as memoryblock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 3.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Fills the ResultDouble property.
If paramtercount is 0, the memoryblock is ignored.
The size of the memoryblock must be minimum 4*paramcount.
Each parameter is set using m.long(n*4) where n=0 is the first parameter.
A parameter may be any integer value or an address of a memoryblock. The address can be read using memoryblock.addressMBS which is part of the plugin.
Only 10 parameters can currently be used.
See also:
SoftDeclareMBS.CallFunctionInteger64(param as string,data as memoryblock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 7.7 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The param string is a combination of the characters "i" for integer, "l" for 64bit integer, "f" for single (float) and "d" for double.
Use "i" for booleans, shorts and pointers.
the memoryblock must match exactly the parameters you specified.
Returns true on success.
See also:
SoftDeclareMBS.CallFunctionInteger64(paramcount as Integer,data as memoryblock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 3.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Fills the ResultInt64 property.
If paramtercount is 0, the memoryblock is ignored.
The size of the memoryblock must be minimum 4*paramcount.
Each parameter is set using m.long(n*4) where n=0 is the first parameter.
A parameter may be any integer value or an address of a memoryblock. The address can be read using memoryblock.addressMBS which is part of the plugin.
Only 10 parameters can currently be used.
See also:
SoftDeclareMBS.CallMethod(param as string,data as memoryblock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 7.7 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The param string is a combination of the characters "i" for integer, "l" for 64bit integer, "f" for single (float) and "d" for double.
Use "i" for booleans, shorts and pointers.
the memoryblock must match exactly the parameters you specified.
Returns true on success.
See also:
SoftDeclareMBS.CallMethod(paramcount as Integer,data as memoryblock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 7.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If paramtercount is 0, the memoryblock is ignored.
The size of the memoryblock must be minimum 4*paramcount.
Each parameter is set using m.long(n*4) where n=0 is the first parameter.
A parameter may be any integer value or an address of a memoryblock. The address can be read using memoryblock.addressMBS which is part of the plugin.
Only 10 parameters can currently be used.
Returns true on success.
See also:
SoftDeclareMBS.CopyLibrary(byref target as SoftDeclareMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 7.7 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
if target is nil, a new object is created.
The library handle in the target object is set to point to the same library as the original object.
SoftDeclareMBS.FreeLibrary as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 5.4 | ❌ No | ✅ Yes | ❌ No | ❌ No | All |
Only for Windows currently this function releases the handles and unloads the library. Windows internally has a reference counter for the library so memory is only released when the last reference is freed.
Lasterror is set.
SoftDeclareMBS.LoadConstant(constname as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Lasterror is set.
Some examples using this method:
SoftDeclareMBS.LoadDLL(libname as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 5.4 | ❌ No | ✅ Yes | ❌ No | ❌ No | All |
Lasterror is set.
libname can be name (e.g. "KERNEL32"), filename (e.g. "KERNEL32.DLL") or path (e.g. "C:\WINDOWS\KERNEL32.DLL").
SoftDeclareMBS.LoadDLLfromMemory(data as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 7.7 | ❌ No | ✅ Yes | ❌ No | ❌ No | All |
Some libraries don't like to be loaded from a string.
But else you can pass any DLL file content to this function.
The string is locked so it stays in memory.
On success the handle property is not zero and the function returns true.
SoftDeclareMBS.LoadDylib(path as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 5.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Lasterror and Liberror are set.
Some examples using this method:
SoftDeclareMBS.LoadFramework(frameworkfilename as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 5.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
frameworkfilename is e.g. "Carbon.framework"
Lasterror is set.
SoftDeclareMBS.LoadFrameworkFile(frameworkpath as folderitem) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 3.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true if successfull.
Lasterror is set.
SoftDeclareMBS.LoadFunction(funcname as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
A user's question:
I am trying to call this to Carbon.framework using the softdeclare function:
UInt32 SwapQDTextFlags(UInt32 newFlags);
flags are OR'd
kQDUseDefaultTextRendering = 0
kQDUseTrueTypeScalerGlyphs = (1 << 0)
kQDUseCGTextRendering = (1 << 1)
kQDUseCGTextMetrics = (1 << 2)
kQDDontChangeFlags = 0xFFFFFFFF
The call is to make the system use Quartz rendering for QuickDraw text (like the text in my WASTEField). How should I call this?
The solution code is above without any error checking!
Lasterror is set.
SoftDeclareMBS.LoadLibrary(libname as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
On Mac OS X e.g. "Carbon.framework" or "System.framework".
On Mac OS Carbon inside Classic e.g. "CarbonLib".
On Windows e.g. "KERNEL32" or "USER32".
Lasterror is set.
SoftDeclareMBS.ParametersSupported(param as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Declare | MBS Util Plugin | 7.7 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The param string is a combination of the characters "i" for integer, "l" for 64bit integer, "f" for single (float) and "d" for double.
Use "i" for booleans, shorts and pointers.
Any new parameter string can be added. Please send an email to support to get a new combination added.
The items on this page are in the following plugins: MBS Util Plugin.