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 code | Description |
|---|---|
|
Success. |
|
The specified index is out of bounds. |
|
Overflow occurred while computing the upper bound. |
|
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 |
|
|---|---|
|
Library |
|
|
DLL |
|
Show: