Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Schedules single or periodic notifications.
Syntax
HRESULT retVal = object.Advise(vtimeMin, vtimeMax, vtimeInterval, dwFlags, pTimerSink, pdwCookie);
Parameters
vtimeMin [in]
Type: VARIANTA VARIANT of type DWORD that specifies the earliest time that the notification can occur.
vtimeMax [in]
Type: VARIANTA VARIANT of type DWORD that specifies the latest time that the notification can occur. This should be zero if the timer has no expiration.
vtimeInterval [in]
Type: VARIANTA VARIANT of type DWORD that specifies the desired interval between notifications. This should be zero for a single (nonperiodic) callback.
dwFlags [in]
Type: DWORDReserved. Must be set to 0.
pTimerSink [in]
Type: ITimerSinkA pointer to the ITimerSink interface to receive the events.
pdwCookie [out]
Type: DWORDA pointer to a DWORD address to receive a cookie identifying the event request.
Remarks
By setting vtimeMax to zero, the timer will not expire; it must be explicitly stopped by calling ITimer::Unadvise. By setting vtimeInterval to zero, after a notification is sent, the notification is automatically removed.
The ITimer::Advise method can be used to simulate two Dynamic HTML (DHTML) methods: IHTMLWindow2::setTimeout and IHTMLWindow2::setInterval. For example, IHTMLWindow2::setTimeout generates a single callback after the number of milliseconds specified. To accomplish this with ITimer::Advise, call the method with the following parameters.
- vtimeMin = timeCurrent + number of milliseconds until the timer times out.
- vtimeMax = 0
- vtimeInterval = 0
To simulate IHTMLWindow2::setInterval, which generates recurring callbacks after the specified number of milliseconds, call ITimer::Advise with the following parameters.
- vtimeMin = timeCurrent + number of milliseconds until the timer times out.
- vtimeMax = 0
- vtimeInterval = number of milliseconds until the timer times out.