CHMlib Logo Leading Translation Management System for Translation Agencies, Top Translation Management Software for Freelance Translators, Time Tracking Software, Word Count, Character Count and Line Count Software, Computer Assisted Translation Tool for Easy Word Count, Clipboard Character Count Software, User-Friendly Translation Memory Software, Terminology Management Software, Terminology Management Server, Microsoft Glossary Software, Dictionary of Acronyms, Social Network for Translators and Translation Agencies, Acronyms and Abbreviations Search Engine, Russian Translation Lab, Ukrainian Translation Lab.
You are reading help file online using chmlib.com
CrisisHelper - First Aid in Tough Times of World Economic Crisis


The Microsoft.com Speech website Microsoft Speech SDK

SAPI 5.1

ISpRecoGrammar::LoadCmdFromResource

ISpRecoGrammar::LoadCmdFromResource loads a command and control grammar from a Win32 resource.


HRESULT LoadCmdFromResource(
   HMODULE         hModule,
   const WCHAR    *pszResourceName,
   const WCHAR    *pszResourceType,
   WORD            wLanguage,
   SPLOADOPTIONS   Options
);

Parameters

hModule
[in] Handle to the module whose file name is being requested. If this parameter is NULL, it passes back the path for the file containing the current process.
pszResourceName
[in, string] The name of the resource.
pszResourceType
[in, string] The type of the resource.
wLanguage
[in] The language ID.
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 Either pszResourceName or pszResourceType is invalid or bad. It may also indicate hModule could not be found. Alternatively, Options is neither SPLO_STATIC nor SPLO_DYNAMIC.
FAILED(hr) Appropriate error message.

Remarks

When an application calls ::LoadCmdFromResource, the currently loaded context-free grammar or proprietary grammar will be unloaded.

The CFG resource must be a compiled SAPI 5 binary version of a context-free grammar (see ISpGrammarCompiler::CompileStream).

Example

    HRESULT hr = S_OK;

    // create a new grammar object
    hr = cpRecoContext->CreateGrammar(GRAM_ID, &cpRecoGrammar);
    // Check hr
 
    // load a CFG resource from the current module, named SRGRAMMAR
    hr = cpRecoGrammar->LoadCmdFromResource(hModule,
                                            (const WCHAR*)MAKEINTRESOURCE(IDR_GRAMMAR),
                                            L"SRGRAMMAR",
                                            ::SpGetUserDefaultUILanguage()
                                            , SPLO_STATIC);
    // Check hr


You are reading help file online using chmlib.com

If you want your help file to be removed or added please send e-mail to chmlibcom@gmail.com
Partner sites: Logo Design, Simple Anti-Crisis Accounting Software, Voice Search for Web