Share via


Note

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

Microsoft Speech Platform

ISpRecoGrammar::LoadCmdFromObject

ISpRecoGrammar::LoadCmdFromObject loads a context-free grammar (CFG) from a COM object.

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT LoadCmdFromObject(</strong> <strong> REFCLSID</strong> <em>rcid</em>, <strong> LPCWSTR</strong> *<em>pszGrammarName</em>, <a runat="server" href="jj127470(v=msdn.10).md"><strong>SPLOADOPTIONS</strong></a> <em>Options</em> <strong>);</strong> </pre>

Parameters

  • rcid
    [in] The reference class ID of the object containing the command.
  • pszGrammarName
    [in, string] The grammar name of the object containing the command.
  • Options
    [in] Flag of type SPLOADOPTIONS indicating whether the file should be loaded statically or dynamically.

Return Values

Value Description
S_OK Function completed successfully.
E_INVALIDARG pszGrammarName is invalid or bad. Alternatively, Options is neither SPLO_STATIC nor SPLO_DYNAMIC.
FAILED(hr) Appropriate error message.

Remarks

When an application calls ::LoadCmdFromObject, the currently loaded CFG will be unloaded.