SafeArrayCopyData

This function copies the source array to the target array after releasing any resources in the target array. This function is similar to SafeArrayCopy, except that the target array has to be set up by the caller. The target is not allocated or reallocated.

At a Glance

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

Syntax

HRESULT SafeArrayCopyData(SAFEARRAY FAR* psaSource, SAFEARRAY FAR* FAR* psaTarget);

Parameters

psaSource

Pointer to the safe array to be copied.

psaTarget

On exit, pointer to the array referred to by psaTarget that contains a copy of the data in psaSource.

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 safearray descriptor.
E_OUTOFMEMORY Insufficient memory to create the copy.

Remarks

Visual Basic for Applications and Automation use the same set of rules with cases in which the size or types of source and destination arrays do not match. The rules of Visual Basic are described in the following comments. Passing into this function any invalid and, under some circumstances, NULL pointers will result in unexpected termination of the application.