次の方法で共有


SafeArrayPtrOfIndex (Compact 2013)

3/26/2014

This function retrieves a pointer to an array element.

Syntax

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

Parameters

  • rgIndices
    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 void pointer to the element identified by the values in rgIndices.

Return Value

Returns the HRESULT values shown in the following table.

Value

Description

S_OK

Success.

E_INVALIDARG

The psa parameter was not a valid safearray descriptor.

DISP_E_BADINDEX

The specified index was invalid.

Remarks

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

Passing invalid (and under some circumstances NULL) pointers to this function causes an unexpected termination of the application.

Requirements

Header

oleauto.h

Library

oleaut32.lib

See Also

Reference

Automation Functions
SafeArrayCreate
SafeArrayUnlock
SafeArrayLock