Share via


ISpEventSource::SetInterest (Windows Embedded CE 6.0)

1/6/2010

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.

Syntax

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 Value

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

Header sapi.h, sapi.idl
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

ISpEventSource
SAPI Interfaces