ISpObjectTokenCategory::GetId (Microsoft Speech Platform)

Microsoft Speech Platform SDK 11

Microsoft Speech Platform

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 CoTaskMemFree when no longer required.

Return values

Value Description
S_OK Function completed successfully.
SPERR_UNINITIALIZED Category interface is not initialized.
E_POINTER ppszCoMemCategoryId 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);
}