Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Microsoft Speech Platform

ISpObjectTokenCategory::GetDataKey

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

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT GetDataKey(</strong><a runat="server" href="jj127458(v=msdn.10).md"><strong>SPDATAKEYLOCATION</strong></a> <em>spdkl</em>, <strong> ISpDataKey</strong> **<em>ppDataKey</em> <strong>);</strong> </pre>

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.

`

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

`