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

隨筆 - 74, 文章 - 0, 評論 - 26, 引用 - 0
數據加載中……

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

Microsoft Speech API 5.3   用oleview 可以產生 idl 文件 再用 midl工具 可以產生 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 井泉 閱讀(1206) 評論(1)  編輯 收藏 引用 所屬分類: C++

評論

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

你好,我在試驗這個例子的時候遇見了問題。我不知道Example的那段代碼應該加到哪里。我試驗了一下,出現了錯誤。所以,希望你能詳細的指點我一下,可以么?謝謝啦!我的郵箱是: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>
            欧美一级淫片aaaaaaa视频| 国产精品日韩欧美一区二区| 欧美在线观看视频| 欧美区在线观看| 在线观看av一区| 亚洲欧美日韩精品久久久| 亚洲国产精品一区二区www| 欧美激情亚洲一区| 久久久999| 有码中文亚洲精品| 久久在线播放| 久久国产精品久久久久久电车| 国产精品第13页| 一区二区三区国产在线| 欧美成人精精品一区二区频| 欧美一区二区黄| 国产欧美精品xxxx另类| 欧美一区亚洲一区| 久久爱91午夜羞羞| 韩国v欧美v日本v亚洲v| 久久精品30| 久久激情婷婷| 黄色工厂这里只有精品| 美日韩在线观看| 精久久久久久久久久久| 欧美午夜不卡视频| 午夜欧美大尺度福利影院在线看| 正在播放欧美一区| 国产精品羞羞答答| 久久男女视频| 欧美国产大片| 亚洲综合不卡| 性高湖久久久久久久久| 怡红院av一区二区三区| 欧美激情精品久久久久久久变态| 久热这里只精品99re8久| 亚洲美女视频| 亚洲视频电影图片偷拍一区| 国产伦精品一区二区三区高清版 | 欧美自拍偷拍午夜视频| 欧美日韩国产综合在线| 久久国产福利| 蜜桃av一区二区| 日韩亚洲视频| 欧美一区二区三区啪啪| 国产精品国产三级国产专播品爱网 | 性欧美超级视频| 久久久91精品国产| 中文在线资源观看视频网站免费不卡| 亚洲九九爱视频| 国产农村妇女毛片精品久久莱园子 | 日韩亚洲欧美高清| 亚洲欧美成人在线| 亚洲国内精品| 亚洲影视在线播放| 亚洲国产99| 亚洲影院污污.| 亚洲裸体在线观看| 久久精品久久综合| 亚洲一区二区三区精品动漫| 久久精品一区四区| 亚洲欧美激情诱惑| 欧美777四色影视在线| 欧美中在线观看| 欧美日韩亚洲一区二区三区在线| 看欧美日韩国产| 国产精品日韩专区| 亚洲精品欧美激情| 亚洲国产精品女人久久久| 亚洲国产精品一区| 国产日韩亚洲欧美| 一本色道久久88亚洲综合88| 亚洲福利视频免费观看| 欧美在线高清视频| 午夜精品久久久久久久99热浪潮| 猛干欧美女孩| 免费不卡在线视频| 国产主播一区| 性欧美长视频| 欧美一区二区女人| 国产精品入口尤物| 一区二区三区高清在线观看| 99re视频这里只有精品| 欧美电影美腿模特1979在线看| 老司机精品福利视频| 国产欧美日韩免费| 亚洲欧美高清| 亚欧成人在线| 亚洲精品国产品国语在线app| 久久九九国产精品怡红院| 欧美好吊妞视频| 欧美一区二区三区视频在线观看| 激情亚洲成人| 狠狠色狠狠色综合人人| 国产精品区一区二区三| 亚洲网站视频| 最新亚洲一区| 国产一区二区三区网站| 蜜臀久久久99精品久久久久久 | 亚洲理论在线观看| 亚洲视频免费| 午夜精品久久久久久久蜜桃app| 麻豆av一区二区三区| 欧美一区二区三区日韩| 一区二区三区在线视频播放| 国产欧美一区二区三区久久人妖| 欧美精品午夜视频| 午夜精品剧场| 欧美一区二区三区久久精品| 欧美日韩国产三级| 亚洲精品一区二区在线观看| 亚洲精品国偷自产在线99热| 最新热久久免费视频| 国产精品99久久久久久久久久久久| 久久精品国产久精国产一老狼 | 亚洲日韩欧美视频一区| 欧美不卡视频一区| 亚洲国产一区二区三区在线播| 午夜精品久久久久久久男人的天堂 | 久久成人国产| 国产精品一区二区三区四区五区 | 欧美福利小视频| 亚洲激情小视频| 亚洲天堂偷拍| 国产亚洲欧美一区二区| 久久夜色精品国产噜噜av| 亚洲激情视频| 午夜精品久久久久久久男人的天堂 | 亚洲欧洲一区| 欧美日韩激情小视频| 午夜精品一区二区三区电影天堂 | 久久国产高清| 亚洲激情女人| 国产精品成人观看视频免费| 欧美中文字幕视频| 亚洲精品免费在线播放| 欧美一区二区三区男人的天堂| 在线精品一区| 国产精品人成在线观看免费| 久久婷婷亚洲| 亚洲一区二区在线免费观看视频 | 欧美在线日韩| 亚洲人体偷拍| 韩国av一区二区三区四区| 欧美日韩日本国产亚洲在线| 欧美中文字幕在线视频| 亚洲精选视频免费看| 久久这里有精品视频| 亚洲欧美一区二区激情| 亚洲精品一区二区三区四区高清 | 国产美女精品视频免费观看| 亚洲黄色高清| 亚洲视频一区在线| 亚洲国产小视频在线观看| 欧美一区二区三区久久精品| 一区二区免费看| 亚洲激情欧美| 亚洲电影自拍| 怡红院精品视频| 黄色一区二区在线观看| 国产日韩精品一区二区三区| 欧美午夜精品理论片a级大开眼界 欧美午夜精品理论片a级按摩 | 美女黄网久久| 久久国产精品99国产精| 亚洲天堂成人在线视频| 日韩视频在线免费| 亚洲精品极品| 亚洲精品自在久久| 亚洲美女精品久久| 亚洲精品偷拍| 亚洲欧洲精品一区二区三区| 欧美国产精品一区| 欧美丰满少妇xxxbbb| 国产麻豆日韩| 国产精品美女久久久久av超清 | 亚洲免费视频中文字幕| 亚洲视频大全| 亚洲一区二区视频在线观看| 日韩视频精品| 一区二区三区福利| 亚洲特级毛片| 欧美一级在线视频| 欧美国产视频在线| 欧美在线看片| 久久一区二区三区四区五区| 麻豆国产精品777777在线 | 久久亚洲国产成人| 久久久久久一区| 久色婷婷小香蕉久久| 欧美高清在线一区| 欧美午夜激情小视频| 国产精品亚洲网站| 国产午夜亚洲精品羞羞网站| 国内精品美女在线观看| 亚洲大片av| 在线视频亚洲一区| 久久黄金**| 亚洲高清av在线| 日韩视频在线一区二区三区| 亚洲一区二区三区在线观看视频|