Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SPCreateDefaultObjectFromCategoryID

Helper SpCreateDefaultObjectFromCategoryId (SAPI 5.4)

Speech API 5.4
Microsoft Speech API 5.4

SpCreateDefaultObjectFromCategoryId

SpCreateDefaultObjectFromCategoryId creates the object instance from the default object token of a specified category.

Found in: sphelper.h

SpCreateDefaultObjectFromCategoryId(
   const WCHAR   *pszCategoryId,
   T             **ppObject,
   IUnknown      *pUnkOuter = NULL,
   DWORD         dwClsCtxt = CLSCTX_ALL
);

Parameters

pszCategoryId
[in] The type of object token to create.
ppObject
[out] The object being created.
pUnkOuter
[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] The type of aggregate object being created. If pUnkOuter is not NULL, this must be supplied. If not specified otherwise, the value defaults to all object types.

Return values

ValueDescription
S_OKFunction completed successfully.
FAILED (hr)Appropriate error message.

Example


// Declare local identifiers:
HRESULT               hr = S_OK;
CComPtr<ISpAudio>     cpAudio;

hr = SpCreateDefaultObjectFromCategoryId(SPCAT_AUDIOIN, &cpAudio;);

if (SUCCEEDED(hr))
{
   // Do stuff here.
}	
Show:
© 2015 Microsoft