COleSafeArray::PutElement

void PutElement( long* rgIndices, LPVOID pvData );

Parameters

rgIndices

Pointer to an array of indexes for each dimension of the array.

pvData

Pointer to the data to assign to the array. VT_DISPATCH, VT_UNKNOWN, and VT_BSTR variant types are pointers and do not require another level of indirection.

Remarks

Call this function to assign a single element into the array. This function automatically calls the Windows functions SafeArrayLock and SafeArrayUnlock before and after assigning the element. If the data element is a string, object, or variant, the function copies it correctly, and if the existing element is a string, object, or variant, it is cleared correctly.

Note that you can have multiple locks on an array, so you can put elements into an array while the array is locked by other operations.

On error, the function throws a CMemoryException or COleException.

COleSafeArray OverviewClass MembersHierarchy Chart

See Also   COleSafeArray::GetElement, SafeArrayPutElement