You are reading help file online using chmlib.com
|
ISpObjectToken::RemoveStorageFileName removes the object token file name.
HRESULT RemoveStorageFileName(
REFCLSID clsidCaller,
const WCHAR *pszKeyName,
BOOL fDeleteFile
);
Value | Description |
---|---|
S_OK | Function completed successfully. |
E_INVALIDARG | pszKeyName is invalid or bad. |
SPERR_UNINITIALIZED | Either the data key or token delegate interface is not initialized. |
SPERR_TOKEN_DELETED | Key has been deleted. |
FAILED(hr) | Appropriate error message. |
HRESULT hr;
GUID guid0;
CComPtr<ISpObjectToken> cpSpObjectToken;
CComPtr<ISpObjectWithToken> cpSpObjectWithToken;
CSpCoTaskMemPtr<WCHAR> cpFileName;
hr = SpGetDefaultTokenFromCategoryId(SPCAT_VOICES, &cpSpObjectToken);
//Check return value
ZeroStruct(guid0);
// Create subkeys and value item to be deleted
hr = cpSpObjectToken->GetStorageFileName(guid0, L"test file", NULL, CSIDL_FLAG_CREATE|CSIDL_APPDATA, &cpFileName);
if (SUCCEEDED(hr))
{
hr = cpSpObjectToken->RemoveStorageFileName(guid0, L"test file", false);
//Check return value
cpFileName.Clear();
}
You are reading help file online using chmlib.com
|