
ISpSREngine::OnCreateGrammar
ISpSREngine::OnCreateGrammar creates a new recognition grammar. Each grammar belongs to a recognition context and can contain dictation, CFG, or proprietary grammar information. The engine can associate a pointer with each grammar that is then passed back to the engine in other methods using this grammar.
HRESULT OnCreateGrammar(
void *pvEngineRecoContext,
SPGRAMMARHANDLE hSAPIGrammar,
void **ppvEngineGrammar
);
Parameters
- pvEngineRecoContext
- [in] The engine's recognition context pointer indicating the context this grammar belongs to. This is the value that the engine passes back to SAPI in the OnCreateRecoContext method.
- hSAPIGrammar
- [in] Unique handle to the grammar.
- ppvEngineGrammar
- [out] The engine should set the contents of this to an arbitrary pointer containing any information the engine has associated with this grammar.
Return values
Value | Description |
---|---|
S_OK | Function completed successfully. |
FAILED(hr) | Appropriate error message. |