다음을 통해 공유


ISpGrammarBuilder::CreateNewState (Windows CE 5.0)

Send Feedback

This method creates a new state in the same grammar rule as the supplied existing state.

HRESULT CreateNewState(SPSTATEHANDLE hState,SPSTATEHANDLE* phState);

Parameters

  • hState
    [in] Handle to any existing state in the grammar rule.
  • phState
    [out] Pointer to the handle for a new state in the same grammar rule.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
E_INVALIDARG The hState is not a valid state handle.
E_POINTER The phState pointer is invalid.
E_OUTOFMEMORY Exceeded available memory.

Example

The following code example illustrates the use of this method.

HRESULT hr = S_OK;
SPSTATEHANDLE hInit;
hr = pGrammarBuilder->GetRule(L"rule1", 1, 0, TRUE, &hInit);
// CreateNewState using the hInitState.
SPSTATEHANDLE hState;
hr = pGrammarBuilder->CreateNewState(hInit, &hState);
// Check hr.
// CreateNewState using hState != hInit.
SPSTATEHANDLE hState2;
hr = pGrammarBuilder->CreateNewState(hState, &hState2);
// 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.