Share via


IDebugArrayObject::GetElement

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Gets an element of the array.

Syntax

HRESULT GetElement( 
   DWORD          dwIndex,
   IDebugObject** ppElement
);
int GetElement(
   [In] uint dwIndex,
   out IDebugObject ppElement
);

Parameters

dwIndex
[in] The element index.

ppElement
[out] Returns an IDebugObject interface that represents the element.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Remarks

This method sees all of the elements of an array object as a one-dimensional array, even if the array object is multi-dimensional. For example, given the array myarray[3][2][6] and a dwIndex parameter of 20, this method would return the element from myarray[1][1][2], and a dwIndex parameter of 21 would return the element from myarray[1][1][3]. Use the GetCount method to determine the total number of elements in the array.

See also