ISpSREngine::SetGrammarState (Windows CE 5.0)

Send Feedback

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.

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

Parameters

  • pvEngineGrammar
    [in] Pointer to the grammar for the engine. It is retrieved by a prior call to the ISpSREngine::OnCreateGrammar method.
  • eGrammarState
    [in] Pointer to the new state of the grammar. Possible values are defined for the SPGRAMMARSTATE enumeration.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
FAILED(hr) Appropriate error message.

Requirements

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

See Also

ISpSREngine | SAPI Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.