ISpGrammarBuilder::ResetGrammar (Windows Embedded CE 6.0)
1/6/2010
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.
Syntax
HRESULT ResetGrammar(
LANGID NewLanguage
);
Parameters
- NewLanguage
[in] Language identifier associated with the grammar rule.
Return Value
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
Header | sapi.h, sapi.idl |
Library | sapilib.lib |
Windows Embedded CE | Windows CE .NET 4.1 and later |