Windows apps
Collapse the table of content
Expand the table of content

SafeArrayGetUBound Function

Returns the upper bound for any dimension of a safe array.

HRESULT SafeArrayGetUBound(  
  SAFEARRAY *  psa, 
  unsigned int  nDim,  
  long *  plUbound  
);

psa

Pointer to an array descriptor created by SafeArrayCreate.

nDim

The array dimension for which to get the upper bound.

plUbound

Pointer to the location to return the upper bound.

The return value obtained from the returned HRESULT is one of the following.

Return value

Meaning

S_OK

Success.

DISP_E_BADINDEX

The specified index is out of bounds.

E_INVALIDARG

One of the arguments is invalid.

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;

   // 

}
Show:
© 2017 Microsoft