function SafeArrayLock(VarArray: PVarArray): HRESULT;
long __fastcall SafeArrayLock(System::TVarArray * VarArray);
Locks a safe array.
SafeArrayLock locks the safe array given through the VarArray parameter. VarArray is a pointer to the safe array.
The possible return values of SafeArrayLock are listed in the following table, together with their meaning.
The operation was completed successfully.
The given argument is nil.
The array given through VarArray is locked.
If the locking operation succeeded, VarArray points to an array of elements in which the leftmost dimension increases first. In other words, the dimensions of the returned array pointer are reversed from the dimensions of the safe array.
Tip: Once SafeArrayLock verifies that the safe array has the correct bounds and dimensions, SafeArrayLock can be used to gain direct access to the array data, which results in improved performance.