System.VarUtils.SafeArrayRedim

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function SafeArrayRedim(VarArray: PVarArray; const NewBound: TVarArrayBound): HRESULT;
function SafeArrayRedim(VarArray: PVarArray; NewBound: PVarArrayBound): HRESULT; external oleaut name 'SafeArrayRedim';

C++

extern DELPHI_PACKAGE HRESULT __stdcall SafeArrayRedim _DEPRECATED_ATTRIBUTE1("use SafeArrayRedim(VarArray: PVarArray; NewBound: PVarArrayBound)") (System::PVarArray VarArray, const System::TVarArrayBound &NewBound)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.VarUtils.pas
System.VarUtils.hpp
System.VarUtils System.VarUtils

Description

Changes the bound information for the last dimension of a safe array.

SafeArrayRedim resizes the safe array given through the VarArray parameter, by changing the bound information for the last dimension of the array, according to the NewBound parameter. VarArray is a pointer to the safe array.

The possible return values of SafeArrayRedim are listed in the following table, together with their meaning.



Value Meaning

VAR_OK

The operation was completed successfully.

VAR_INVALIDARG

The given argument is nil.

VAR_ARRAYISLOCKED

The array given through VarArray is locked.

VAR_EXCEPTION

The application raised an exception.

VAR_OUTOFMEMORY

There is not enough memory to complete the operation.



After the resizing operation took place, the existing elements of the array are preserved and the new elements are set to zero or empty.

Note: A safe array cannot be resized while it is locked.

See Also