Helper SpCreateObjectFromSubToken

Microsoft Speech SDK

The Microsoft.com Speech website Microsoft Speech SDK SAPI 5.1

SpCreateObjectFromSubToken

SpCreateObjectFromSubToken creates an object from a specified subtoken.

Found in: spddkhlp.h

SpCreateObjectFromSubToken(
   ISpObjectToken   *pToken,
   const WCHAR      *pszSubKeyName,
   T               **ppObject,
   IUnknown          pUnkOuter = NULL,
   DWORD            *dwClsCtxt = CLSCTX_ALL
);

Parameters

pToken
[in] Address of a pointer to an ISpObjectToken object containing the information associated with the tokens being added.
pszSubKeyName
[in] Address of a null-terminated string specifying the name of the subkey of the pToken's corresponding datakey to open.
ppObject
[out, iid_is(riid)] Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, ppObject contains the requested interface pointer. If the object does not support the interface specified in riid, the implementation must set ppObject to NULL.
IUnknown
[in] Optional parameter used for creating aggregate objects. pUnkOuter is the data for the object. If not specified, the value defaults to NULL.
dwClsCtxt
[in] Context in which the code that manages the newly created object will run. It should be one of the following values. If not specified, the value defaults to CLSCTX_ALL.
  • CLSCTX_INPROC_SERVER
  • CLSCTX_INPROC_HANDLER
  • CLSCTX_LOCAL_SERVER
  • CLSCTX_REMOTE_SERVER

Return values

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