ISpObjectTokenCategory::EnumTokens
This method enumerates the tokens for the category by attempting to match specified requirements.
HRESULT EnumTokens(
const WCHAR* pszReqAttribs,
const WCHAR* pszOptAttribs,
IEnumSpObjectTokens** ppEnum
);
Parameters
- pszReqAttribs
[in] Pointer to required attributes for the token. - pszOptAttribs
[in] Pointer to optional attributes for the token. - ppEnum
[out] Address of a pointer to an IEnumSpObjectTokens object representing an enumerated list of the tokens found. The order in which the tokens are listed is based on the order of the specified attributes.
Return Values
The following table shows the possible return values.
Value | Description |
---|---|
S_OK | Function completed successfully. |
SPERR_UNINITIALIZED | Data key interface is not initialized. |
E_POINTER | At least one of the parameters is invalid or bad. |
FAILED(hr) | Appropriate error message. |
Example
The following code snippet demonstrates getting a complete enumerated token list. Because no specific requirement is given (pszReqAttribs and pszOptAttribs are NULL), all values are returned for SPCAT_VOICES.
CComPtr<ISpObjectTokenCategory> cpSpCategory;
CComPtr<IEnumSpObjectTokens> cpSpEnumTokens;
HRESULT hr;
hr = SpGetCategoryFromId(SPCAT_VOICES, &cpSpCategory);
//Check hr
hr = cpSpCategory->EnumTokens(NULL, NULL, &cpSpEnumTokens);
//Check hr
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.