Share via


ISpObjectTokenCategory::GetDataKey (SAPI 5.3)

Microsoft Speech API 5.3

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
S_OK
SPERR_UNINITIALIZED
E_POINTER
FAILED(hr)

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.
}