ISpObjectTokenCategory::GetDataKey

This method gets the data key associated with a specific location.

HRESULT GetDataKey(
  SPDATAKEYLOCATION spdkl,
  ISpDataKey** ppDataKey
);

Parameters

  • spdkl
    [in] A value indicating the top-level registry node to search for the data key. Possible values are defined by the SPDATAKEYLOCATION enumeration.
  • ppDataKey
    [out] Address of a pointer to the ISpDataKey object associated with the provided registry node.

Return Values

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 ppDataKey is invalid or bad.
FAILED(hr) Appropriate error message.

Example

The following snippet gets the data key associated with the local registry (HKEY_LOCAL_MACHINE) for an data key location type of SPCAT_VOICES.

HRESULT hr;

CComPtr cpSpCategory;
CComPtr cpSpDataKey;

hr = SpGetCategoryFromId(SPCAT_VOICES, &cpSpCategory);
//Check return code

hr = cpSpCategory->GetDataKey(SPDKL_LocalMachine, &cpSpDataKey);
//Check return code

Requirements

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

See Also

ISpObjectTokenCategory | SAPI Interfaces

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.