다음을 통해 공유


SpCreateNewToken (By Category ID) (Windows CE 5.0)

Send Feedback

This function creates a token coercively, based on category identifier. The token is created with the specified name, if provided. Otherwise, the function automatically generates a unique name.

inline HRESULT SpCreateNewToken(const WCHAR* pszCategoryId,const WCHAR* pszTokenKeyName,ISpObjectToken** ppToken);

Parameters

  • pszCategoryId
    [in] Pointer to a category identifier.
  • pszTokenKeyName
    [in, out] Pointer to the token key name. On input, an optional token key name is provided, or NULL. On output, this parameter points to the provided name with "Tokens" appended before it. If NULL is furnished as an input, the output is a unique token key name generated by the function.
  • ppToken
    [out] Address of a pointer to an object implementing ISpObjectToken. The token is created, if one does not currently exist.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
FAILED(hr) Appropriate error message.

Example

The following code snippet illustrates the use of SpCreateNewToken (By Category ID) with the SPCAT_RECOPROFILES category identifier.

HRESULT hr = S_OK;
// create a new recognition profile
hr = SpCreateNewToken(SPCAT_RECOPROFILES, NULL, &cpObjectToken);
// Check hr

Requirements

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

See Also

SAPI Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.