Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SafeArrayGetUBound function

Gets the upper bound for any dimension of the specified safe array.

Syntax


HRESULT SafeArrayGetUBound(
  _In_  SAFEARRAY *psa,
  _In_  UINT      nDim,
  _Out_ LONG      *plUbound
);

Parameters

psa [in]

An array descriptor created by SafeArrayCreate.

nDim [in]

The array dimension for which to get the upper bound.

plUbound [out]

The upper bound.

Return value

This function can return one of these values.

Return codeDescription
S_OK

Success.

DISP_E_BADINDEX

The specified index is out of bounds.

DISP_E_OVERFLOW

Overflow occurred while computing the upper bound.

E_INVALIDARG

One of the arguments is not valid.

 

Examples


HRESULT
CEnumPoint::Create(SAFEARRAY * psa, CEnumPoint ** ppenum)
{
   long uBound;
   HRESULT hresult;

   // Verify that the SafeArray is the proper shape.
   hresult = SafeArrayGetUBound(psa, 1, &uBound);
   if(FAILED(hresult))
      return hresult;

   // Code omitted here for brevity
}

Requirements

Header

OleAuto.h

Library

OleAut32.lib

DLL

OleAut32.dll

 

 

Show:
© 2017 Microsoft