System.VarUtils.SafeArrayCopyData

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function SafeArrayCopyData; external oleaut name 'SafeArrayCopyData';

Properties

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

Description

Copies the data from a safe array to another.

Use SafeArrayCopyData to copy over the data from the safe array given through SourceArray to the safe array stored in TargetArray.

In order to copy the data from the safe array, SafeArrayCopyData first checks if the source array is valid and also establishes that the source and target arrays are compatible. SafeArrayCopyData then locks the source array, clears up the data in the target array, and copies over the data from the source array. Finally, the source array is unlocked.

If SafeArrayCopyData managed to copy over the data from the source array, then TargetArray contains the copied data. If the two arrays are incompatible, SafeArrayCopyData returns a VAR_INVALIDARG value. Otherwise, it returns VAR_OK

See Also