青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

隨筆 - 74, 文章 - 0, 評論 - 26, 引用 - 0
數(shù)據(jù)加載中……

(msdn)Using MFC to Automate SAPI (SAPI 5.3)http://msdn2.microsoft.com/en-us/library/ms717069.aspx

Microsoft Speech API 5.3   用oleview 可以產(chǎn)生 idl 文件 再用 midl工具 可以產(chǎn)生 tlb,h,c 存根文件 等.

Using MFC to Automate SAPI

Introduction

The Microsoft Foundation Classes (MFC) provides an easy and convenient way to automate calls to SAPI using its Class Wizard to generate wrappers for the SAPI layer from the SAPI Type Library.

In order to accomplish this, perform the following steps:

  1. Create a new MFCAppWizard(exe) project in Visual C++.
  2. Based on the type of application you are creating, follow the wizard prompts. In Step 3 of the wizard prompts, (or Step 2 if you are creating a Dialog Based application) make sure that the Automation check box is selected under the heading, What other support would you like to include?

Once the new project is ready, access Class Wizard.

  1. Click the Automation tab, and then click Add Class and select From a type library in the drop-down list.
  2. Browse for the sapi.dll file and open it.
  3. Select the classes you would like Class Wizard to generate a wrapper for. The resulting default header and implementation files are sapi.h and sapi.cpp respectively. The rest of this document assumes that you have chosen to use these default file names. Click OK.
  4. You should now be back in the Class Wizard window. Click OK.
After you are done with the above steps, Visual C++ will automatically add the Class Wizard generated files sapi.cpp and sapi.h to your project.

Upon viewing the sapi.h file, you should notice that it is nothing more than an automation wrapper that has been generated for all the classes you selected. Notice that all the classes inherit from COleDispatchDriver, hence the dispatch interface needs to be set up. This only requires a few lines of simple code, after which the wrapper class can be used just like any other C++ class.

Example

This example assumes that you chose to generate a wrapper for the ISpeechVoice class from among any other classes you may have selected. Using the project created above, include the sapi.h file within a source file in the project that will make automation calls to SAPI using the wrapper. In that source file, type the following code.

CLSID CLSID_SpVoice;    // class ID for the SAPI SpVoice object
LPDISPATCH pDisp; // dispatch interface for the class
ISpeechVoice voice; // use the MFC Class Wizard generated wrapper

CLSIDFromProgID(L"SAPI.SpVoice", &CLSID;_SpVoice);
voice.CreateDispatch(CLSID_SpVoice);
pDisp = voice.m_lpDispatch;

HRESULT hr = pDisp->QueryInterface(CLSID_SpVoice, (void**)&voice;.m_lpDispatch);

if (hr == S_OK) {
pDisp->Release();
}
else {
voice.AttachDispatch(pDisp, TRUE);
}

voice.Speak("hello world", 1); // asynchronous call to Speak method of ISpeechVoice interface

If you have been following the steps outlined above properly, you should hear your computer say "hello world!" That's all there is to using MFC to make automation calls to SAPI. Currently however, not all the wrapper classes generated by MFC's Class Wizard work properly. For instance, the ISpeechLexicon interface does not work. The work around for this is to implement your own automation wrapper classes using C++. The steps to do that are beyond the scope of this document. Of course, you can always use the COM interfaces in C++ and Automation in Visual Basic to ensure that every interface in SAPI works easily and flawlessly.

posted on 2007-11-20 09:06 井泉 閱讀(1205) 評論(1)  編輯 收藏 引用 所屬分類: C++

評論

# re: (msdn)Using MFC to Automate SAPI (SAPI 5.3)http://msdn2.microsoft.com/en-us/library/ms717069.aspx[未登錄]  回復(fù)  更多評論   

你好,我在試驗(yàn)這個(gè)例子的時(shí)候遇見了問題。我不知道Example的那段代碼應(yīng)該加到哪里。我試驗(yàn)了一下,出現(xiàn)了錯(cuò)誤。所以,希望你能詳細(xì)的指點(diǎn)我一下,可以么?謝謝啦!我的郵箱是:nvllnvll@126.com
2010-03-19 22:07 | Harry
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美在线观看视频一区二区三区| 亚洲欧美综合网| 日韩午夜免费| 国产日韩欧美夫妻视频在线观看| 欧美天天综合网| 欧美超级免费视 在线| 欧美在线观看天堂一区二区三区 | 欧美精品色网| 久久亚洲精品视频| 亚洲欧美日韩国产一区二区三区 | 精品福利免费观看| 亚洲第一天堂av| 亚洲人成网站精品片在线观看| 怡红院精品视频在线观看极品| 禁断一区二区三区在线| 韩国一区二区在线观看| 伊人久久av导航| 激情视频一区二区三区| 亚洲精品在线三区| 午夜精品在线| 免费精品视频| 一区二区三区毛片| 久久国产加勒比精品无码| 久久国产高清| 欧美精彩视频一区二区三区| 国产精品网站一区| 女仆av观看一区| 国产精品福利久久久| 韩国一区二区在线观看| aⅴ色国产欧美| 欧美一站二站| 欧美国产亚洲视频| 亚洲无线一线二线三线区别av| 午夜精品国产精品大乳美女| 美女黄色成人网| 国产精品一区二区黑丝| 在线观看日产精品| 亚洲剧情一区二区| 亚洲欧美亚洲| 欧美激情国产日韩精品一区18| 亚洲一区区二区| 欧美剧在线免费观看网站| 欧美成人中文字幕在线| 亚洲国产精品热久久| 亚洲一级黄色| 欧美www视频在线观看| 在线亚洲美日韩| 久久超碰97中文字幕| 欧美午夜a级限制福利片| 韩国精品在线观看| 在线综合欧美| 亚洲国产高清在线观看视频| 亚洲视频在线观看免费| 欧美久久久久久| 国产亚洲一区二区在线观看| 亚洲视频欧美在线| 亚洲精品小视频在线观看| 欧美激情精品久久久久久大尺度| 极品少妇一区二区三区精品视频| 久久精品一二三| 亚洲综合视频一区| 国产日韩欧美一区| 久久久久国产一区二区| 欧美一级一区| 国产午夜精品麻豆| 久久久国产精品一区二区三区| 性欧美精品高清| 国产日韩欧美a| 欧美伊人久久久久久午夜久久久久 | 一区精品在线| 久久综合激情| 久热国产精品| 亚洲精品国产系列| 亚洲日本免费电影| 欧美日韩国产影院| 午夜国产精品视频| 欧美一区免费视频| 永久555www成人免费| 欧美福利视频在线观看| 欧美精品久久久久久| 亚洲一区影音先锋| 性视频1819p久久| 狠狠色综合网站久久久久久久| 久久一区视频| 嫩模写真一区二区三区三州| 亚洲理论在线观看| 亚洲在线一区二区| 国产视频久久| 欧美aaaaaaaa牛牛影院| 欧美日韩国产片| 久久99伊人| 美女脱光内衣内裤视频久久影院| 日韩亚洲一区二区| 亚洲欧美激情诱惑| 亚洲激情视频在线观看| 中文av字幕一区| 永久域名在线精品| 一区二区免费在线观看| 亚洲欧美在线x视频| 久久中文在线| 欧美一级精品大片| 欧美日韩在线一区| 欧美一区二区三区婷婷月色 | 亚洲高清av在线| 亚洲美女网站| 激情伊人五月天久久综合| 欧美激情网站在线观看| 国产精品久久久久久影视| 看欧美日韩国产| 国产精品扒开腿爽爽爽视频| 久久躁日日躁aaaaxxxx| 国产精品久久| 亚洲丰满在线| 国产亚洲精品aa| 亚洲理伦在线| 亚洲狠狠丁香婷婷综合久久久| 亚洲视频中文| 亚洲免费高清| 另类春色校园亚洲| 久久精品亚洲精品国产欧美kt∨| 欧美精品九九| 亚洲风情在线资源站| 黄色一区二区三区四区| 亚洲午夜精品视频| 中文在线一区| 欧美激情一区在线观看| 免费视频亚洲| 狠狠色狠狠色综合| 欧美亚洲一区二区在线观看| 亚洲欧美日韩一区二区在线| 欧美日韩高清免费| 亚洲娇小video精品| 伊人久久亚洲热| 欧美一区亚洲二区| 久久高清国产| 国产精品一级二级三级| 日韩午夜一区| 夜夜爽www精品| 欧美黄色aa电影| 欧美国产高潮xxxx1819| 1024日韩| 久久久亚洲成人| 欧美91大片| 91久久精品视频| 欧美精品在线一区二区| 日韩一区二区精品视频| 亚洲一区精彩视频| 国产精品一区毛片| 亚洲在线视频网站| 久久国产精品久久久久久电车| 国产精品午夜av在线| 欧美一区激情视频在线观看| 久久综合给合久久狠狠狠97色69| 黄色亚洲网站| 男女激情视频一区| 亚洲美女中出| 欧美亚洲一区二区在线观看| 国产欧美精品va在线观看| 久久久久se| 亚洲黄色在线看| 欧美v国产在线一区二区三区| 欧美国产乱视频| 日韩一级欧洲| 欧美性大战久久久久久久蜜臀| 一区二区三区日韩在线观看| 欧美一区二区三区的| 国产日韩精品在线观看| 另类av一区二区| 一区二区免费在线播放| 久久亚洲综合| 一本色道久久综合亚洲精品小说| 国产精品无码专区在线观看 | 国产精品视频精品视频| 久久精品亚洲乱码伦伦中文| 亚洲第一页在线| 亚洲欧美激情视频| 激情一区二区| 国产精品av免费在线观看| 久久国产视频网站| 亚洲欧洲综合| 久久久久亚洲综合| 中文亚洲欧美| 亚洲国产精品成人久久综合一区| 欧美日韩三级视频| 久久久久高清| 一区二区欧美精品| 欧美国产精品劲爆| 久久福利视频导航| 在线视频亚洲欧美| 亚洲第一色在线| 国产日韩亚洲欧美| 欧美性色综合| 欧美激情偷拍| 久久久人成影片一区二区三区| 一区二区国产精品| 亚洲电影在线看| 免费国产自线拍一欧美视频| 欧美一区二区啪啪| 亚洲一区精品电影| 一区二区精品在线观看|