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

隨筆 - 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>
            国产精品久久| 久久综合色天天久久综合图片| 另类春色校园亚洲| 欧美成人激情视频| 一本色道久久综合狠狠躁的推荐| 美女日韩欧美| 国产一区二区中文| 一区二区三区四区国产| 亚洲黄色片网站| 亚洲综合精品| 国产精品久久久久久久久久免费 | 欧美成人精品h版在线观看| 亚洲精品小视频| 亚洲欧美日韩另类| 欧美日韩一区二区视频在线| 国产综合久久久久久| 亚洲午夜精品福利| 在线视频欧美一区| 欧美日韩国产精品一卡| 亚洲国产欧美国产综合一区| 欧美a级片一区| 久久国产精品网站| 亚洲狠狠婷婷| 欧美国产高清| 日韩系列在线| 国产精品videossex久久发布| 亚洲精品社区| 亚洲六月丁香色婷婷综合久久| 欧美激情中文字幕在线| 亚洲精品一区二区三区蜜桃久| 日韩网站在线观看| 欧美精品自拍偷拍动漫精品| 一区二区三区精品| 亚洲乱码国产乱码精品精天堂 | 欧美激情一区二区在线| av成人免费在线| 亚洲理伦在线| 国产欧美一区二区精品仙草咪| 亚洲欧美日韩一区二区| 中文亚洲欧美| 伊人久久亚洲美女图片| 久久亚洲欧美国产精品乐播| 欧美黄色精品| 欧美精品尤物在线| 亚洲一区二区三区高清 | 欧美日韩www| 国产日韩欧美综合在线| 亚洲精品美女在线| 亚洲免费成人av| 国产精品久久久久一区二区三区| 久久精品国产99国产精品| 久久免费视频在线观看| 国产麻豆午夜三级精品| 久久综合影音| 欧美精品久久久久久| 亚洲激情精品| 日韩一级片网址| 国产精品久久久久久久一区探花| 久久国内精品自在自线400部| 欧美成人黄色小视频| 一区二区三区日韩精品| 午夜精品剧场| 亚洲一区二区三区成人在线视频精品| 午夜视频久久久久久| 一区二区高清在线| 性色av一区二区三区| 亚洲精品美女在线观看| 久久久久成人精品| 亚洲午夜视频在线观看| 美女尤物久久精品| 亚洲视频在线观看视频| 久久久人成影片一区二区三区| 亚洲自拍电影| 夜夜精品视频| 久久福利毛片| 亚洲欧美日韩精品久久奇米色影视 | 久久综合九色综合久99| 国内精品久久国产| 亚洲欧洲在线视频| 欧美日韩高清免费| 美女视频黄免费的久久| 国产一区久久| 欧美激情精品久久久久久久变态| 亚洲第一中文字幕| 午夜精品福利一区二区三区av| 亚洲高清在线观看| 欧美一区成人| 99国产精品国产精品毛片| 亚洲欧美激情视频| 性久久久久久久久久久久| 久久精品视频在线看| 日韩视频二区| 午夜精品99久久免费| 国产伦理一区| 久久亚洲综合色| 蜜桃av综合| 日韩一级不卡| 国产精品美女视频网站| 久久国产精品久久w女人spa| 久久亚洲精品一区| 小辣椒精品导航| 亚洲精品国产精品乱码不99| 欧美日韩精品一区二区天天拍小说 | 久久综合网络一区二区| 9人人澡人人爽人人精品| 亚洲黄色免费网站| 亚洲免费视频一区二区| 国产综合av| 国产亚洲欧洲| 你懂的国产精品永久在线| 亚洲人成网站色ww在线| 亚洲激情国产| 欧美激情一区二区三区 | 亚洲黄网站黄| 欧美在线高清视频| 99精品国产一区二区青青牛奶| 国产欧美一区二区三区在线看蜜臀| 欧美亚洲视频| 亚洲欧美日韩一区二区在线 | 亚洲综合第一页| 一区二区三区四区五区视频| 免费成人av资源网| 麻豆成人av| 亚洲国产精品悠悠久久琪琪| 黄色成人在线网址| 韩国女主播一区| 亚洲高清在线播放| 国内成+人亚洲| 国产婷婷一区二区| 国产日产欧产精品推荐色| 国产日韩一级二级三级| 国产精品福利网站| 樱花yy私人影院亚洲| 亚洲精品欧美日韩专区| 国产精品v一区二区三区| 国产精品你懂的在线| 亚洲第一天堂av| 久久久久综合网| 亚洲欧洲精品一区二区三区不卡 | 久久精品中文字幕一区二区三区| 免费久久99精品国产| 亚洲美女电影在线| 欧美成人综合| 黄色成人在线观看| 欧美一区二区免费观在线| 亚洲三级视频| 欧美jizzhd精品欧美巨大免费| 欧美一区二区三区四区夜夜大片| 欧美一区二区高清在线观看| 久久久蜜臀国产一区二区| 亚洲国产精品第一区二区| 亚洲永久字幕| 噜噜噜噜噜久久久久久91| 欧美日韩国产电影| 国产精品午夜在线观看| 最新成人av在线| 亚洲第一区中文99精品| 久久综合一区二区| 国内精品久久久久影院 日本资源| 亚洲第一精品夜夜躁人人爽| 久久亚洲综合| 国产日韩亚洲欧美综合| 久久精品国产免费看久久精品| 国产日韩一区二区三区在线播放| 激情视频一区二区| 久久精品视频在线免费观看| 久久国产精品久久久久久久久久| 亚洲欧美日韩直播| 亚洲免费在线看| 老司机成人在线视频| 一区二区三区高清| 欧美一区二区三区男人的天堂| 99re热精品| 久久艳片www.17c.com| 你懂的亚洲视频| 欧美福利视频在线| 欧美四级电影网站| 久久久久久一区二区| 欧美女人交a| 欧美国产精品日韩| 亚洲国产精品国自产拍av秋霞| 亚洲精品欧美日韩专区| 亚洲日本国产| 欧美国产视频日韩| 六月丁香综合| 国产婷婷97碰碰久久人人蜜臀| 亚洲综合色婷婷| 欧美一进一出视频| 国产精品人人做人人爽| 午夜精品久久久久久久久| 久久精彩免费视频| 国产精品乱码人人做人人爱| 欧美成人亚洲成人| 亚洲美女av黄| 欧美伦理在线观看| 一区二区三区欧美在线观看| 久久成人资源| 精品av久久707| 美女亚洲精品| 最近看过的日韩成人|