IEnumSRShare::Share

HRESULT Share(QWORD qwInstanceID, PISRCENTRAL *ppISRCentral);

Allows an application to share an existing engine/audio-source pair.

· Returns NOERROR if successful, or one of these error values:

E_INVALIDARG
E_OUTOFMEMORY
SRERR_VALUEOUTOFRANGE

qwInstanceID

[in] Instance identifier of the desired engine/audio-source pair from the SRSHARE structure. An application can obtain this from the speech-recognition sharing object.

ppISRCentral

[out] Address of a variable that receives a pointer to the ISRCentral interface for the shared engine/audio-source pair.

The instance identifier of an engine/audio-source pair is guaranteed to be unique during the run-time session of Windows. Because Win32 handles multitasking, there's a slight chance that the instance identifier will become invalid between the time the engine/audio-source pair was enumerated and the time when the engine object tries to share it. If an instance identifier is invalid, the function returns an error. Always check the result of this function and handle errors appropriately.