Platform SDK: MAPI

IMAPIProgress::SetLimits

The IMAPIProgress::SetLimits method sets the lower limit for the number of items operated on, the maximum number of items operated on, and the flags that control how progress information is calculated for the operation in question.

Quick Info

See IMAPIProgress : IUnknown.

HRESULT SetLimits(
  LPULONG lpulMin,   
  LPULONG lpulMax,   
  LPULONG lpulFlags  
);
 

Parameters

lpulMin
[in] Pointer to a variable containing the lower limit of items in the operation.
lpulMax
[in] Pointer to a variable containing the upper limit of items in the operation.
lpulFlags
[in] Bitmask of flags that controls the level of operation on which progress information is calculated. The following flag can be set:
MAPI_TOP_LEVEL
Uses the values in the IMAPIProgress::Progress method's ulCount and ulTotal parameters, which indicate the item being operated on and the total items, respectively, to increment progress on the operation. When this flag is set, the values of the global lower and upper limits have to be set.

Return Values

S_OK
The call succeeded and has returned the expected value or values.

Remarks

Service providers call IMAPIProgress::SetLimits to set or clear the MAPI_TOP_LEVEL flag and to set local and global minimum and maximum values. The value of the flags setting affects whether the progress object understands the minimum and maximum values to be local or global. When the MAPI_TOP_LEVEL flag is set, these values are considered global and are used to calculate progress for the entire operation. Progress objects initialize the global minimum value to 1 and the global maximum value to 1000.

When MAPI_TOP_LEVEL is not set, the minimum and maximum values are considered local and are used internally by providers to display progress for lower level subobjects. Progress objects save the local minimum and maximum values only so that they can be returned to providers when GetMin and GetMax are called.

For more information about implementing SetLimits and the other IMAPIProgress methods, see Implementing a Progress Indicator.

For more information about how and when to make calls to a progress object, see Displaying Progress Step by Step.

See Also

IMAPIProgress::Progress