ISpSREngine::SetProprietaryRuleState

Microsoft Speech SDK

The Microsoft.com Speech website Microsoft Speech SDK SAPI 5.1

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, 
   const WCHAR   *pszName,
   const WCHAR   *pszValue,
   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.
pszValue
[in, string] Null-terminated string that contains rule value information (Currently always NULL).
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 Description
S_OK Function completed successfully.
FAILED(hr) Appropriate error message.

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.