ISpRecoContext::GetMaxAlternates
ISpRecoContext::GetMaxAlternates retrieves the maximum number of alternates that the SR engine will return for command and control or proprietary grammars associated with this context. See Remarks section.
HRESULT GetMaxAlternates(
ULONG *pcMaxAlternates
);
Parameters
- pcMaxAlternates
- [out] The maximum number of alternates. The default value is zero, unless the application specifies it by ISpRecoContext::SetMaxAlternates.
Return values
Value | Description |
---|---|
S_OK | Function completed successfully. |
E_POINTER | pcMaxAlternates is invalid or bad. |
FAILED(hr) | Appropriate error message. |
Remarks
The value is the maximum number of alternates that will be returned to the application. For SR engine's that do not support command and control (or proprietary grammar) alternates, this method will succeed, but the alternates returned 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.
This method has no effect on dictation alternates. See ISpRecoResult::GetAlternates for information regarding dictation alternates.
Versions of the Microsoft SR engine up to 5.1 did not support command and control alternates, but versions 6.0 and above do.