SafeArrayCopy

This function creates a copy of an existing safe array.

At a Glance

Header file: Oleauto.h
Windows CE versions: 2.0 and later

Syntax

HRESULT SafeArrayCopy(SAFEARRAY FAR* psa,
SAFEARRAY FAR* FAR*
ppsaOut);

Parameters

psa

Pointer to an array descriptor created by SafeArrayCreate.

ppsaOut

Pointer to a location in which to return the new array descriptor.

Return Values

One of the values obtained from the returned HRESULT and described in the following table is returned.

Value Description
S_OK Success.
E_INVALIDARG The psa parameter was not a valid safe array descriptor.
E_OUTOFMEMORY Insufficient memory to create the copy.

Remarks

SafeArrayCopy calls the string or variant manipulation functions if the array to copy contains either of these data types. If the array being copied contains object references, the reference counts for the objects are incremented. Passing into this function any invalid and, under some circumstances, NULL pointers will result in unexpected termination of the application.

See Also

SysAllocStringLen, VariantCopy, VariantCopyInd