Partager via


ISpRecoContext::SetMaxAlternates

This method sets the maximum number of alternates that the SR engine will retrieve for command and control or proprietary grammars associated with this context. This number defaults to zero. See Remarks section.

This method has no effect on dictation alternates. See ISpRecoResult::GetAlternates for information regarding dictation alternates.

The current version of the Microsoft SR engine does not support command and control alternates.

HRESULT SetMaxAlternates(
  ULONG cAlternates
);

Parameters

  • cAlternates
    [in] Maximum number of alternates the engine will retrieve.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
FAILED(hr) Appropriate error message.

Remarks

The value is the maximum number of alternates that will be retrieved for the application. For SR engines that do not support command and control (or proprietary grammar) alternates, this method will succeed, but the alternates retrieved will always be zero.

For applications and SR engines that are using proprietary grammars and proprietary alternates, ISpRecoContext::GetMaxAlternates and ISpRecoContext::SetMaxAlternates is the recommended method of coordinating maximum alternate values between the application and SR engine.

The SR engine can query each context's maximum requested alternates value by calling ISpSREngineSite::GetContextMaxAlternates with the context handle. When using SAPI command and control grammars, the SR engine can call ISpSREngineSite::GetMaxAlternates with the rule handle.

Requirements

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

See Also

ISpRecoContext | SAPI Interfaces

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.