ISpObjectTokenCategory::EnumTokens (Windows Embedded CE 6.0)
1/6/2010
This method enumerates the tokens for the category by attempting to match specified requirements.
Syntax
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 Value
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
Header | sapi.h, sapi.idl |
Library | sapilib.lib |
Windows Embedded CE | Windows CE .NET 4.1 and later |