ISpObjectTokenCategory::GetDataKey (SAPI 5.4)

Speech API 5.4
Microsoft Speech API 5.4

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

ValueDescription
S_OKFunction completed successfully.
SPERR_UNINITIALIZEDData key interface is not initialized.
E_POINTERppDataKey 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.


// Declare local identifiers:
HRESULT                           hr = S_OK;
CComPtr<ISpObjectTokenCategory>   cpSpObjectTokenCategory;
CComPtr<ISpDataKey>               cpSpDataKey;

hr = SpGetCategoryFromId(SPCAT_VOICES, &cpSpObjectTokenCategory;);

if (SUCCEEDED (hr))
{
   hr = cpSpObjectTokenCategory->GetDataKey(SPDKL_LocalMachine, &cpSpDataKey;);
}

if (SUCCEEDED(hr))
{
   // Do stuff here.
}
Show: