ISpObjectTokenCategory::GetDataKey
Other versions of this page are also available for the following:
8/28/2008
This method gets the data key associated with a specific location.
Syntax
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 Value
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
Header | sapi.h, sapi.idl |
Library | sapilib.lib |
Windows Embedded CE | Windows CE .NET 4.1 and later |