我引用speech框架,编译没有错,执行的时候报错!无法将类型为“System.__ComObject”的 COM 对象强制转换为接口类型。。。。。。

问题描述

usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;usingSystem.Speech.Synthesis;namespaceBank{publicpartialclassMain:Form{publicMain(){InitializeComponent();}privatevoidMain_Load(objectsender,EventArgse){SpeechSynthesizera=newSpeechSynthesizer();a.SpeakAsync("Hello");}

无法将类型为“System.__ComObject”的COM对象强制转换为接口类型“System.Speech.Internal.SapiInterop.ISpDataKey”。此操作失败的原因是对IID为“{14056581-E16C-11D2-BB90-00C04F8EE6C0}”的接口的COM组件调用QueryInterface因以下错误而失败:不支持此接口(异常来自HRESULT:0x80004002(E_NOINTERFACE))。

解决方案

解决方案二:
不是本机执行的吧?
解决方案三:
是本机啊,我也很郁闷。。。
解决方案四:
没人能回答啊!
解决方案五:
不好说,在我这是能执行的。
解决方案六:
能把你的系统备份给我吗?估计是我这系统是精简版,网上找了很多系统,安装了还是一样。
解决方案七:
引用4楼ZuoQingYi的回复:

不好说,在我这是能执行的。

能给我备份你的系统吗?好像是我操作系统的问题
解决方案八:
这个帖子说组件没有正确的注册。lz自己看一下吧
解决方案九:
我也是同样的问题,我是C#调用一个C++写的进程外COM组件(EXE),出现这样的问题,请问你解决了吗?

时间: 2024-09-17 04:27:29

我引用speech框架,编译没有错,执行的时候报错!无法将类型为“System.__ComObject”的 COM 对象强制转换为接口类型。。。。。。的相关文章

microsoft office-Word.Application的 COM 对象强制转换为接口类型时报错

问题描述 Word.Application的 COM 对象强制转换为接口类型时报错 asp.net的项目中有个导出word的功能,每当执行 doc = appWord.Documents.Add(ref templateFile, ref objfalse, ref objDocType, ref objtrue); 到这句的时候报错,catch到一个异常 此时,进程里已经产生一个word进程. 在处理异常的时候, doc.Close(ref doNotSaveChanges, ref miss

框架-hql中执行COLLATE utf8_general_ci报错

问题描述 hql中执行COLLATE utf8_general_ci报错 ?我在mysql数据库中执行SELECT * FROM XXX WHERE NAME COLLATE utf8_general_ci LIKE '%e%',可以查询出不区分大小写的数据.但是在SSH框架中,hql却报如下错误:17:27:24,962 hql.PARSER ERROR -line 1:62: unexpected token: COLLATE 解决方案 http://www.cnblogs.com/thin

链表的add不执行也不报错

问题描述 链表的add不执行也不报错 求大神解答,products是范型为Product的List,执行到products.add(product)的时候总是停下,也不报错,这是什么原因啊? 解决方案 Product product = new Product(); product = gDao.get(Product.class sql id); String attrnameids = product.getAttrname(); String []attrnameids2 = attrna

build xml-ant编译,提示build.xml老是报错

问题描述 ant编译,提示build.xml老是报错 解决方案 执行 ANT -V查看详细信息 解决方案二: 执行 ANT -V查看详细信息 解决方案三: 我这个 for 语句有问题么,3Q

json-关于asp josn 接到参数 执行 sql语句 报错问题

问题描述 关于asp josn 接到参数 执行 sql语句 报错问题 <%Dim memberSet member = jsObject() dim dbconnectionuplistDBPathSQLSortLboundUboundDim id=request(""jsoncallback"")set dbconnection=Server.CreateObject(""ADODB.Connection"") DBP

编译Linux2.6.32.2内核报错

问题描述 编译Linux2.6.32.2内核报错 joker@Ghost:~/local/linux-2.6.32$ make CHK include/linux/version.h CHK include/linux/utsrelease.h SYMLINK include/asm -> include/asm-x86 CALL scripts/checksyscalls.sh CHK include/linux/compile.h AS arch/x86/kernel/entry_64.o

using-为什么ASP.NET程序运行时不执行,也不报错?急急,哪位大蚁帮我一把戏?

问题描述 为什么ASP.NET程序运行时不执行,也不报错?急急,哪位大蚁帮我一把戏? 点发布时,屏幕闪一下,没有任何提示,不进行验证,也没有加到SQL2005库中! 前台: <%@ Page Language="C#" validateRequest="false" CodeFile="kjxm_Edit.aspx.cs" Inherits="As_Tzxm_Edit" %> <%@ Register Tag

eclipse安装反编译工具jad打开.class文件报错

问题描述 eclipse安装反编译工具jad打开.class文件报错 /*jadclipse*/ /* DECOMPILATION REPORT Decompiled from: D:mavenrepositoryorgspringframeworkspring-webmvc3.2.4.RELEASEspring-webmvc-3.2.4.RELEASE.jar Total time: 0 ms Jad reported messages/errors: Exit status: 0 Caugh

background-chrome扩展执行tabs.executeScript报错提示no main frame

问题描述 chrome扩展执行tabs.executeScript报错提示no main frame 在选项卡里打开www.baidu.com,然后在background里后台运行chrome.tabs.executeScript(cid, {code:"document.body.innerHTML +='< div >aa< /div >'",allFrames:false}); 提示no main frame:不知道怎么解决. 解决方案 是不是页面没有加载