IInterval::GetLimits Method
When a condition tree expresses that the value of a property must fall in a certain range, it can be expressed as a leaf node. This is done by having the value of the node being a PROPVARIANT with tag VT_UNKNOWN and a punkVal that is a pointer to an object implementing IInterval. IInterval specifies the lower and upper limits of the interval, each of which may be infinite or a specific value.
Syntax
HRESULT GetLimits( INTERVAL_LIMIT_KIND *pilkLower, PROPVARIANT *ppropvarLower, INTERVAL_LIMIT_KIND *pilkUpper, PROPVARIANT *ppropvarUpper );
Parameters
- pilkLower
[out] Returns a pointer to the enumeration used to define the lower bound of the interval. For more details please see INTERVAL_LIMIT_KIND.- ppropvarLower
[out] Returns a pointer to the value for the lower limit of the interval. If ILK_NEGATIVE_INFINITY or ILK_POSITIVE_INFINITY is selected for the pilkLower parameter, this value will be VT_EMPTY.- pilkUpper
[out] Returns a pointer to the enumeration used to define the upper bound of the interval. For more details please see INTERVAL_LIMIT_KIND.- ppropvarUpper
[out] Returns a pointer to the value for the upper limit of the interval. If ILK_NEGATIVE_INFINITY or ILK_POSITIVE_INFINITY is selected for the pilkUpper parameter, this value will be VT_EMPTY.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
When getting interval limits the limits are returned in pairs, the first set containing pilkLower and ppropvarLower, which is a PROPVARIANT that usually contains the value of the lower limit. The second set are pilkUpper and ppropvarUpper, which is also a PROPVARIANT that usually contains the value of the upper limit.
The lower limit must be less then the upper limit or the interval will be empty. The only exception is if the lower and upper limits are equal (or the same value) and both are set to ILK_EXPLICIT_INCLUDED, in which case the range will be the value.
For example:
If GetLimits returns pilkLower as ILK_EXPLICIT_INCLUDED with the PROPVARIANT with the integer 3, pilkUpper as ILK_EXPLICIT_INCLUDED and a PROPVARIANT with the integer 3, we have an interval consisting only of the number 3.
However, if GetLimits returns pilkLower as ILK_EXPLICIT_INCLUDED, a PROPVARIANT with the integer 3, pilkUpper as ILK_EXPLICIT_EXCLUDED and a PROPVARIANT with the integer 3, we have an empty interval.
For the integer interval beginning at and including 3 and ending at but not including 6, GetLimits should return pilkLower as ILK_EXPLICIT_INCLUDED, a PROPVARIANT with the integer 3, pilkUpper as ILK_EXPLICIT_EXCLUDED and a PROPVARIANT with the integer 6.
If the pilkLower parameter is ILK_NEGATIVE_INFINITY and the pilkUpper parameter is set to ILK_POSITIVE_INFINITY everything will be selected.