Share via


ISpRecoContext::GetRecognizer

This method gets a reference to the current recognizer object associated with the speech recognition context.

HRESULT GetRecognizer(
  ISpRecognizer** ppRecognizer
);

Parameters

  • ppRecognizer
    [out] Address of a pointer to an object implementing ISpRecognizer. The application must call IUnknown::Release when finished with the object.

Return Values

The following table shows the possible return values.

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

Example

The following code snippet illustrates the use of this method with a shared context.

HRESULT hr = S_OK;
// create a shared recognition context
hr = cpRecoContext.CoCreateInstance(CLSID_SpSharedRecoContext);
// Check hr
// get a reference to the associated recognizer
hr = cpRecoContext->GetRecognizer(&cpRecognizer);
// Check hr
// assert that our shared context has a shared recognizer
hr = cpRecognizer->IsSharedInstance();
// Check that hr == S_OK

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.