Method AutomationObject():setLBound() Foundation

Sets the lower boundary for COM SafeArray parameters.

Syntax
:setLBound( [<nLBound>] ) --> nOldLBound
Parameters
<nLBound>
The optional numeric parameter <nLBound> specifies the lower boundary of COM SafeArrays which are created for method parameters or property values of a COM/ActiveX component. By default, this value is 1.
Return

:setLBound() returns the old lower boundary setting.

Description

The method :setLBound() can be used to change the lower boundary of all parameters having the COM SafeArray type which are passed to the COM/ActiveX component. This setting only needs to be changed if a COM/ActiveX component has special requirements or limitations which prevent it from working correctly with the default setting.

An example of such a scenario are .Net components which expose their interfaces via COM Interop. These require a specific lower boundary to be set via:setLBound(0). Otherwise, parameter errors may result when calling methods having parameters using the COM SafeArray type.

Note that the lower boundary setting is automatically inherited by the child objects created by a COM/ActiveX component. This means that the lower boundary usually only needs to be set for AutomationObjects created via GetObject() and CreateObject(). Any object created by these AutomationObjects as a result of a method call or property access automatically inherits the parent's lower boundary setting.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.