SafeArrayPtrOfIndex function (oleauto.h)

Gets a pointer to an array element.

Syntax

HRESULT SafeArrayPtrOfIndex(
  [in]  SAFEARRAY *psa,
  [in]  LONG      *rgIndices,
  [out] void      **ppvData
);

Parameters

[in] psa

An array descriptor created by SafeArrayCreate.

[in] rgIndices

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

[out] 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

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