ISpObjectTokenCategory::GetDataKey

Microsoft Speech SDK

The Microsoft.com Speech website Microsoft Speech SDK SAPI 5.1

ISpObjectTokenCategory::GetDataKey

ISpObjectTokenCategory::GetDataKey gets the data key associated with a specific location.


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

Parameters

spdkl
[in] The registry's top-level node to be searched.
ppDataKey
[out] The data key interface associated with the location spdkl.

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 code snippet retrieves the data key associated with the local computer registry for SPCAT_VOICES.

HRESULT hr;

CComPtr<ISpObjectTokenCategory> cpSpCategory;
CComPtr<ISpDataKey> cpSpDataKey;

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

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