Call this method to return the upper bound.

LONG GetUpperBound( ) const throw( );

Returns the upper bound of the CComSafeArrayBound object.

The upper bound depends on the number of elements and the lower bound value. For example, if the lower bound is 0 and the number of elements is 10, the upper bound will automatically be set to 9.

Header: atlsafe.h