SafeArrayPtrOfIndex Function

Returns a pointer to an array element.

HRESULT SafeArrayPtrOfIndex(  
  SAFEARRAY *psa,   
  long *rgIndices,  
  void HUGEP  **ppvData  
);

psa

Pointer to an array descriptor created by SafeArrayCreate.

rgIndices

An array of index values that identify an element of the array. All indexes for the element must be specified.

ppvData

On return, pointer to the element identified by the values in rgIndices.

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.

DISP_E_BADINDEX

The specified index was invalid.

The array should be locked before SafeArrayPtrOfIndex is called. Failing to lock the array can cause unpredictable results.

Show:
© 2015 Microsoft