Share via


ISpEventSource::SetInterest (Windows CE 5.0)

Send Feedback

This method sets the type of events that will invoke a notification and become queued. If SetInterest is never called, the SR engine defaults to SPEI_RECOGNITION as the only event interest. No events will be passed through if both parameters are set to zero. By default, the SpVoice object defaults to zero for both event interest and queued event.

HRESULT SetInterest(  ULONGLONG ullEventInterest,  ULONGLONG ullQueuedInterest);

Parameters

  • ullEventInterest
    [in] Event identifier flags indicating the events that should invoke a notification to the event sink that this event source uses.
  • ullQueuedInterest
    [in] Event identifier flags indicating the events that should be queued. The event flags set here must also be set in ullEventInterest.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
E_INVALIDARG Invalid flags passed in one or more fields.
FAILED(hr) Appropriate error message.

Remarks

The SPFEI macro is used to convert an event enumeration into the appropriate flags to pass to this method. For example, to receive the SPEI_RECOGNITION and SPEI_HYPOTHESIS events, call this method as follows:

ULONGLONG ullMyEvents = SPFEI(SPEI_RECOGNITION) | SPFIE(SPEI_HYPOTHESIS);
Hr = pEventSource->SetInterest(ullMyEvents, ullMyEvents);

Events specified in ullEventInterest must be a superset of those specified in the queued interest (ullQueuedInterest). For events not added to the event queue, but set in ullEventInterest, the notification will be called but no event will be queued. This can be useful for polling the GetStatus method, especially for text to speech.

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Sapi.h, Sapi.idl.
Link Library: Sapilib.lib.

See Also

ISpEventSource | SAPI Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.