Notifies registered objects and applications of the progress of a downloading operation.
HRESULT OnProgress(
DWORD dwProgressCurrent |
// Amount of data available |
DWORD dwProgressMaximum |
// Total amount of data to be downloaded |
BOOL fAccurate |
// Reliability of notifications |
BOOL fOwner |
// Ownership of blocking behavior |
); |
Parameters
[in] Indicates whether this OnProgress call can control the blocking behavior of the operation. If TRUE, the caller can use return values from OnProgress to block (STG_S_BLOCK), retry (STG_S_RETRYNOW), or monitor (STG_S_MONITORING) the operation. If FALSE, the return value from OnProgress has no influence on blocking behavior.
Return Values
This function supports the standard return values E_OUTOFMEMORY, E_UNEXPECTED, E_INVALIDARG, and E_FAIL, as well as the following:
Remarks
Sinks may be inherited by any substorage or substream of a given storage. If no sink is registered, the thread will block until the requested data becomes available, or the download is canceled by the downloader.
Where multiple objects or applications have registered progress notification sinks on a single stream, only one of them can control the behavior of a download. Ownership of the download goes to:
Any one of the sinks can relinquish control to the next connection point by returning STG_S_MONITORING to the connection point making the current caller. Once a connection point obtains control (through receiving STG_S_BLOCK or STG_S_RETRYNOW), all subsequent connection points calling IProgressNotify::OnProgress will set fOwner to FALSE.