Partager via


IReferenceClock::AdvisePeriodic (Windows CE 5.0)

Send Feedback

This method creates a periodic advise request.

HRESULT AdvisePeriodic(REFERENCE_TIMErtStartTime,REFERENCE_TIMErtPeriodTime,HSEMAPHOREhSemaphore,DWORD* pdwAdviseCookie);

Parameters

  • rtStartTime
    [in] Time of the first notification, in 100-nanosecond units.

    Must be greater than zero and less than MAX_TIME.

  • rtPeriodTime
    [in] Time between notifications, in 100-nanosecond units.

    Must be greater than zero.

  • hSemaphore
    [in] Handle to a semaphore, created by the caller.

  • pdwAdviseCookie
    [out] Pointer to a variable that receives an identifier for the advise request.

Return Values

Returns an HRESULT value.

Possible values include the following.

Value Description
S_OK Success.
E_INVALIDARG Invalid time values.
E_OUTOFMEMORY Failure.
E_POINTER Null pointer argument.

Remarks

At each notification time, the clock releases the semaphore specified in the hSemaphore parameter. When no further notifications are required, call Unadvise and pass the pdwAdviseToken value returned from this call.

The following code example creates an advise request that signals five seconds from the time it is created, and again every second thereafter.

IReferenceClock *pRefClock = NULL;
// Get an IReferenceClock pointer (not shown).

DWORD          dwAdviseToken;
HANDLE         hSemaphore = CreateSemaphore(NULL, 0, 0x7FFFFFFF, NULL);
REFERENCE_TIME rtPeriodTime = 10000000; // A one-second interval
REFERENCE_TIME rtNow;

pRefClock->GetTime(&rtNow);
pRefClock->AdvisePeriodic(rtNow + (5 * rtPeriodTime),
                          rtPeriodTime, 
                          hSemaphore, 
                          &dwAdviseToken);
...

pRefClock->Unadvise(dwAdviseToken);

Requirements

DirectShow applications and DirectShow filters have different include file and link library requirements.

For more information, see Setting Up the Build Environment.

Pocket PC: Windows Mobile 5.0 and later
Smartphone: Windows Mobile 5.0 and later
OS Versions: Windows CE 3.0 and later.

See Also

IReferenceClock Interface

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.