Compartir a través de


ISpGrammarBuilder::ResetGrammar (Windows CE 5.0)

Send Feedback

This method clears all grammar rules (undefines them) and resets the grammar's language to the specified new language. State handles for this grammar are no longer valid after this reset.

HRESULT ResetGrammar(LANGID NewLanguage);

Parameters

  • NewLanguage
    [in] Language identifier associated with the grammar rule.

Return Values

The following table shows the possible return values.

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

Example

The following code example illustrates the use of this method.

HRESULT hr = S_OK;
// ResetGrammar when no rules.
hr = pGrammarBuilder->ResetGrammar(409);
// Check hr.
// Set language to default user language.
hr = pGrammarBuilder->ResetGrammar(SpGetUserDefaultUILanguage());
// Check hr.
// Set language to non-English.
hr = pGrammarBuilder->ResetGrammar(MAKELANGID(LANG_CHINESE,
  SUBLANG_CHINESE_SIMPLIFIED));
// Check hr
hr = pGrammarBuilder->ResetGrammar(MAKELANGID(LANG_JAPANESE,
  SUBLANG_DEFAULT));
// Check hr.

Requirements

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

See Also

ISpGrammarBuilder | SAPI Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.