Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ISpObjectTokenCategory::GetId (SAPI 5.3)

Speech API 5.3
Microsoft Speech API 5.3

ISpObjectTokenCategory::GetId

ISpObjectTokenCategory::GetId retrieves the category ID.


HRESULT GetId(
   LPWSTR   **ppszCoMemCategoryId
);

Parameters

ppszCoMemCategoryId
[in] The null-terminated string name of the current category. ppszCoMemCategoryId must be freed with CoMemTaskFree when no longer required.

Return values

ValueDescription
S_OKFunction completed successfully.
SPERR_UNINITIALIZEDCategory interface is not initialized.
E_POINTERppszCoMemCategoryId is invalid or bad.
FAILED(hr)Appropriate error message.

Example

The following code snippet retrieves CategoryId for SPCAT_VOICES.


// Declare local identifiers:
HRESULT                           hr = S_OK;
CComPtr<ISpObjectTokenCategory>   cpSpObjectTokenCategory;
WCHAR                             *cpwszOldID;

hr = SpGetCategoryFromId(SPCAT_VOICES, &cpSpObjectTokenCategory;);

if (SUCCEEDED (hr))
{
   hr = cpSpObjectTokenCategory->GetId(&cpwszOldID;);
}

if (SUCCEEDED (hr))
{
   CoTaskMemFree(cpwszOldID);
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.