You are reading help file online using chmlib.com
|
ISpGrammarBuilder::CreateNewState creates a new state in the same grammar rule as hState.
HRESULT CreateNewState(
SPSTATEHANDLE hState,
SPSTATEHANDLE *phState
);
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. |
The following code snippet illustrates the use of CreateNewState.
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
You are reading help file online using chmlib.com
|