ISpObjectTokenCategory::GetId

This method gets the category identifier.

HRESULT GetId(
  WCHAR** ppszCoMemCategoryId
);

Parameters

  • ppszCoMemCategoryId
    [out] Address of a pointer to a null-terminated string specifying the identifier for the current category. The caller must free the object using CoTaskMemFree when it is no longer needed.

Return Values

The following table shows the possible 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 snippet gets the category identifier for a data key location type of SPCAT_VOICES.

HRESULT hr;

CComPtr cpSpCategory;
CSpCoTaskMemPtr cpwszOldID;

hr = SpGetCategoryFromId(SPCAT_VOICES, &cpSpCategory);
//Check return code

hr = cpSpCategory->GetId(&cpwszOldID);
//Check return code

CoTaskMemFree(cpwszOldID);

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: sapi.h, sapi.idl.
Link Library: Sapilib.lib.

See Also

ISpObjectTokenCategory | SAPI Interfaces

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.