SafeArrayCopy

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

Creates a copy of an existing safe array.

Parameters

psa
Pointer to an array descriptor created by SafeArrayCreate.
ppsaOut
Pointer to a location in which to return the new array descriptor.

Return Value

The return value obtained from the returned HRESULT is one of the following.

Return value Meaning
S_OK Success.
E_INVALIDARG The argument psa was not a valid safe array descriptor.
E_OUTOFMEMORY Insufficient memory to create the copy.

Comments

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.

QuickInfo

  Windows NT: Use version 3.1 and later.
  Windows: Use Windows 95 and later.
  Header: Declared in oleauto.h.
  Import Library: Link with oleaut32.lib.

See Also

SysAllocStringLen, VariantCopy, VariantCopyInd