SafeArrayPtrOfIndex

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

Returns a pointer to an array element.

Parameters

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.

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.
DISP_E_BADINDEX The specified index was invalid.

Comments

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

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.