Share via


ISpGrammarBuilder::Commit

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This method performs consistency checks of the grammar structure, creates the serialized format, and either saves it to the stream provided by SetSaveObjects or reloads it into the SR engine. The method must be called before any changes to the grammar can take effect.

Syntax

HRESULT Commit(
  DWORD dwReserved
);

Parameters

  • dwReserved
    Reserved. Must be zero.

Return Value

The following table shows the possible return values.

Value Description

S_OK

Function completed successfully.

E_INVALIDARG

dwReserved is not zero.

SPERR_UNINITIALIZED

Stream not initialized. Call SetSaveObjects before Commit.

SPERR_NO_RULES

A grammar must have at least one rule and one word.

SPERR_NO_TERMINATING_RULE_PATH

At least one rule is not empty but has no terminating path (path of transitions from the initial state to a NULL state).

SPERR_CIRCULAR_RULE_REF

At least one rule has left recursion (a direct or indirect rule reference to itself originated from the initial state).

SPERR_STATE_WITH_NO_ARCS

At least one rule has a node with no outgoing transitions.

SPERR_EXPORT_DYNAMIC_RULE

Dynamic rules or rules referencing dynamic rules (directly or indirectly) cannot be exported.

Requirements

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

See Also

Reference

ISpGrammarBuilder
SAPI Interfaces