Windows Dev Center

SafeArrayGetLBound Function

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

HRESULT SafeArrayGetLBound(  
  SAFEARRAY *  psa, 
  unsigned int  nDim,  
  long *  plLbound  
);

psa

Pointer to an array descriptor created by SafeArrayCreate.

nDim

The array dimension for which to get the lower bound.

plLbound

Pointer to the location to return the lower 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 lBound;
   HRESULT hresult;
   CEnumPoint * penum;


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

   // Code omitted here for brevity.
}
Show:
© 2015 Microsoft