
检索 COM 类工厂中 CLSID 为 {96749377-3391-11D2-9EE3-00C04F797396} 的组件失败,异常0x80040154,没有注册类问题分析和解决办法
提供源代码,和解决问题的文件下载。
//阅读函数
private void Read(string text)
{
SpVoice sp = new SpVoice();//报错位置
sp.Rate = GetSpeedSelected();
SpeechVoiceSpeakFlags sFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
sp.Speak(text, sFlags);
}
有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。
************** 异常文本 **************
System.Runtime.InteropServices.COMException (0x80040154): 检索 COM 类工厂中
CLSID 为 {96749377-3391-11D2-9EE3-00C04F797396} 的组件失败,原因是出现以下错误:
80040154 没有注册类 (异常来自 HRESULT:0x80040154 (REGDB_E_CLASSNOTREG))。
在 System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject
(RuntimeType objectType)
在 System.Runtime.Remoting.Activation.ActivationServices.CreateInstance
(RuntimeType serverType)
在 System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK
(RuntimeType serverType, Object[] props, Boolean bNewObj)
在 System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal&
ctor, Boolean& bNeedSecurityCheck)
在 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
在 System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean
skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
在 System.Activator.CreateInstance(Type type, Boolean nonPublic)
在 System.Activator.CreateInstance(Type type)
在 SpeakDemo.Form1.Read(String text) 位置 c:\Users\Administrator\Desktop
\SpeakDemo\SpeakDemo\SpeakDemo\Form1.cs:行号 32
在 SpeakDemo.Form1.btnRead_Click(Object sender, EventArgs e) 位置 c:\Users
\Administrator\Desktop\SpeakDemo\SpeakDemo\SpeakDemo\Form1.cs:行号 43
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button,
Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/shumachanpin/article-40219-1.html
相信党和国家
储备黄金