Share via


ISpSREngine::OnCreateGrammar (Windows Embedded CE 6.0)

1/6/2010

This method informs the SR engine of the creation of a new speech recognition grammar. Each grammar can contain dictation, CFG, or proprietary grammar information, and belongs to a specific speech recognition context (ISpRecoContext).

This method associates a pointer with the new grammar. SAPI passes this pointer when calling other methods for the grammar.

Syntax

HRESULT OnCreateGrammar(
  void* pvEngineRecoContext,
  SPGRAMMARHANDLE hSAPIGrammar,
  void** ppvEngineGrammar
);

Parameters

  • pvEngineRecoContext
    [in] Pointer to the speech recognition context to which the grammar belongs. The pointer is retrieved by a prior call to the ISpSREngine::OnCreateRecoContext method.
  • hSAPIGrammar
    [in] Unique handle to the grammar.
  • ppvEngineGrammar
    [out] Address of an arbitrary pointer to information that the engine has associated with the grammar.

Return Value

The following table shows the possible return values.

Value Description

S_OK

Function completed successfully.

FAILED(hr)

Appropriate error message.

Requirements

Header sapiddk.h, sapiddk.idl
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

ISpSREngine
SAPI Interfaces