Share via


ISpSREngine::SetGrammarState

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This method sets the grammar state. SAPI calls the method when a grammar has been stopped or started by the application calling ISpRecoGrammar::SetGrammarState.

For standard CFG and dictation grammars, the engine might not need to take any account of the grammar state, as SAPI automatically activates and deactivates the contents of the grammar as necessary. However, for proprietary grammars the engine might need to look at the grammar state.

Syntax

HRESULT SetGrammarState(
  void* pvEngineGrammar,
  SPGRAMMARSTATE* eGrammarState
);

Parameters

  • eGrammarState
    [in] Pointer to the new state of the grammar. Possible values are defined for the SPGRAMMARSTATE enumeration.

Return Value

The following table shows the possible return values.

Value Description

S_OK

Function completed successfully.

FAILED(hr)

Appropriate error message.

Requirements

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

See Also

Reference

ISpSREngine
SAPI Interfaces