SafeArrayPtrOfIndex function (oleauto.h)

Gets a pointer to an array element.

Syntax

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

Parameters

psa

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

The array element.

Return value

This function can return one of these values.

Return code Description
S_OK
Success.
DISP_E_BADINDEX
The specified index is not valid.
E_INVALIDARG
One of the arguments is not valid.

Remarks

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

Requirements

   
Target Platform Windows
Header oleauto.h
Library OleAut32.lib
DLL OleAut32.dll