From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function SafeArrayCopyData; external oleaut name 'SafeArrayCopyData';


extern "C" HRESULT __stdcall SafeArrayCopyData(System::PVarArray SourceArray, System::PVarArray TargetArray);


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


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