Share via


ISpSREngine::SetProprietaryRuleState (SAPI 5.3)

Microsoft Speech API 5.3

ISpSREngine::SetProprietaryRuleState

ISpSREngine::SetProprietaryRuleState sets the proprietary grammar rule state. This is used to activate or deactivate rules in non-standard proprietary grammars, where each rule is identified by a string name.

  
    HRESULT SetProprietaryRuleState(
   void          *pvEngineGrammar,
   LPCWSTR       *pszName,
   void          *pReserved,
SPRULESTATE    NewState,
   ULONG         *pcRulesChanged
);

Parameters

  • pvEngineGrammar
    [in] The engine's grammar pointer for this grammar, as returned from a previous call to the OnCreateGrammar method.
  • pszName
    [in, string] Null-terminated string that contains the grammar rule name, or NULL to indicate all top-level rules should be activated in this grammar.
  • pReserved
    Reserved for future use.
  • NewState
    [in] One of the grammar rule states specified in the SPRULESTATE enumeration sequence.
  • pcRulesChanged
    [out] The number of rules whose state has been changed. This should be set to 1 if a specific rule name was supplied.

Return values

Value
S_OK
FAILED(hr)

Remarks

If ::SetProprietaryRuleState is called with the rule name set to NULL, the engine should activate or deactivate all top-level rules in this grammar. The pcRulesChanged parameter must be set to the number of rules whose state has changed.