Share via


ISpRecoContext::GetRecognizer (Windows Embedded CE 6.0)

1/6/2010

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

Syntax

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 Value

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

Header sapi.h, sapi.idl
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

ISpRecoContext
SAPI Interfaces