Share via


ISpObjectTokenCategory::GetId (SAPI 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

Value
S_OK
SPERR_UNINITIALIZED
E_POINTER
FAILED(hr)

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);
}