ISpObjectToken::Remove (Windows Embedded CE 6.0)

1/6/2010

This method removes an object token.

Syntax

HRESULT Remove(
  const CLSID* pclsidCaller
);

Parameters

  • pclsidCaller
    [in] Pointer to the CLSID associated with the object token to remove. If the identifier is NULL, the method removes the entire token. Otherwise, it only removes the specified section.

Return Value

The following table shows the possible return values.

Value Description

S_OK

Function completed successfully.

E_POINTER

pclsidCaller is invalid or bad.

SPERR_UNINITIALIZED

The token identifier interface is uninitialized.

SPERR_TOKEN_DELETED

Key has been deleted.

FAILED(hr)

Appropriate error message.

Example

The following code snippet creates and removes an object token for a test file.

HRESULT hr;
GUID guid0;
CComPtr cpSpObjectToken;
CSpCoTaskMemPtr cpFileName;
hr = SpGetDefaultTokenFromCategoryId(SPCAT_VOICES, &cpSpObjectToken);
//Check return value
ZeroStruct(guid0);
hr = cpSpObjectToken->GetStorageFileName(
guid0, L"TestFile", NULL, CSIDL_FLAG_CREATE|CSIDL_APPDATA, &cpFileName
);
//Check return value
hr = cpSpObjectToken->Remove(&guid0);
//Check return value

Requirements

Header sapi.h, sapi.idl
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

ISpObjectToken
SAPI Interfaces