다음을 통해 공유


ISpRecoContext::Resume (Windows CE 5.0)

Send Feedback

This method releases the SR engine from the paused state and restarts the recognition process. This method must be called after each call to ISpRecoContext::Pause. It must also be called when a bookmark event occurs that pauses the recognition engine or an auto-pause rule is recognized (see ISpRecoGrammar::SetRuleState).

HRESULT Resume(DWORD dwReserved);

Parameters

  • dwReserved
    [in] Reserved. Must be 0.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
E_INVALIDARG dwFlags is not set to zero.

Example

The following code snippet illustrates the use of ISpRecoContext::Resume after a call to ISpRecoContext::Pause.

HRESULT hr = S_OK;
// setup the recognition context
// ...
// pause the context so that event notifications are not received
hr = cpRecoContext->Pause( NULL );
// Check hr
// [quickly] perform the processing - see ISpRecoContext::Pause Remarks section
// ...
hr = cpRecoContext->Resume( NULL );
// Check hr
// applications will start receiving event notifications again
The following code snippet illustrates the use of ISpRecoContext::Resume with
an "auto-pause" rule.
HRESULT hr = S_OK;
// setup the recognition context and grammar
// ...
// start a top-level rule as an "auto-pause" rule
hr = cpRecoGrammar->SetRuleState( MY_AUTOPAUSE_RULE, NULL,
SPRS_ACTIVE_WITH_AUTO_PAUSE);
// Check hr
// get the recognition event for MY_AUTOPAUSE_RULE in a CSpEvent object
// ...
// assert that the recognition context paused after the "auto-pause" rule was
recognized
SPDBG_ASSERT(spEvent.IsPaused());
// stop the "auto-pause" rule
hr = cpRecoGrammar->SetRuleState( MY_AUTOPAUSE_RULE, NULL, SPRS_INACTIVE );
// Check hr
// activate the second rule
hr = cpRecoGrammar->SetRuleState( MY_SECOND_RULE, NULL, SPRS_ACTIVE );
// Check hr
// Because the context was paused from the "auto-pause" rule, it must now be reactivated to recognize the second rule
hr = cpRecoContext->Resume( NULL );
// Check hr
// get the second recognition... 

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Sapi.h, Sapi.idl.
Link Library: Sapilib.lib.

See Also

ISpRecoContext | SAPI Interfaces

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.