Share via


SpGetCategoryFromId

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This function creates an object token category as an object implementing ISpObjectTokenCategory. This function assists in locating and creating an object token category without having to search or change the registry directly.

Syntax

inline HRESULT SpGetCategoryFromId(
  const WCHAR* pszCategoryId,
  ISpObjectTokenCategory** ppCategory,
  BOOL fCreateIfNotExist = FALSE
);

Parameters

  • pszCategoryId
    [in] Pointer to the category identifier.
  • ppCategory
    [out] Address of a pointer to an object implementing ISpObjectTokenCategory. The object is created with CoCreateInstance and must be manually freed when no longer required.
  • fCreateIfNotExist
    [in] An optional value indicating if the object is to be created if it does not already exist. Set this value to TRUE to create the object, and to FALSE otherwise. FALSE is the default.

Return Value

The following table shows the possible return values.

Value Description

S_OK

Function completed successfully.

FAILED(hr)

Appropriate error message.

Requirements

Header sphelper.h
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

SAPI Functions