COMException exception is thrown when an unrecognized HRESULT is returned from a COM method call." data-guid="6fffbb9f1b13ca675066e3ef4057a393">当 COM 方法调用返回一个无法识别的 HRESULT 时,将引发 COMException 异常。

检查该异常的 ErrorCode 属性,以确定 COM 对象返回的 HRESULT

COMException exception, which includes a public ErrorCode property that contains the HRESULT returned by the call." data-guid="d7af2dce64dc133b8cf5fc4b60580caa">当运行时遇到不熟悉的 HRESULT 时,会引发 COMException 异常,该异常包含一个公共的 ErrorCode 属性,其中含有调用所返回的 HRESULT。 如果运行时有可用错误信息,则将相应信息返回调用方。 但是,如果 COM 组件开发人员未能包含错误信息,则运行时返回八位数的 HRESULT 代替消息字符串。 拥有 HRESULT 使调用方能够确定异常的原因。 How to: Map HRESULTs and Exceptions." data-guid="89ba5841a53333901be1ab7220488607">有关更多信息,请参见 如何:映射 HRESULT 和异常

禁用宿主进程。

COM 用于在 Visual Studio 和宿主进程之间进行通信。 CoInitializeSecurity causes this exception to be thrown." data-guid="6829042bcbf788339b5858dfb782853b">因为它是在代码运行前使用的,所以调用 CoInitializeSecurity 将引发此异常。

备注

公共语言运行时 (CLR) 将已知的 HRESULTS 转换成 .NET 异常,这使 COM 对象能够将有意义的错误信息返回托管客户端。 HRESULTS 到异常的映射还可以反向工作,即将特定的 HRESULT 返回到非托管客户端。

COMException exception may be thrown when the objects are COM objects." data-guid="4f207b2f96974eb85ac5e295d1c289e1">将后期绑定参数传递给 Microsoft Office 对象的方法以后,如果这些对象是 COM 对象,则可能引发 COMException 异常。 ByRef parameter and that the property you pass has a Set accessor." data-guid="36905b328deb0670aad358f7a1a8c229">后期联编程序假定:此类方法调用涉及 ByRef 参数,并且所传递的属性具有 Set 访问器。 MissingMethodException exception (HRESULT CORE_E_MISSINGMETHOD)." data-guid="e7d4209accd14e61fa697749aea3781b">如果相应属性不具有该访问器,则 .NET Framework 生成一个 MissingMethodException 异常 (HRESULT CORE_E_MISSINGMETHOD)。 要处理此行为,请使用早期绑定对象或传递变量而不是对象的属性。

关于异常的疑难解答:System.Runtime.InteropServices.COMException的更多相关文章

  1. excel System.Runtime.InteropServices.COMException (0x80010105): 服务器出现意外情况。 (异常来自 HRESULT:0x80010105 (RPC_E

    System.Runtime.InteropServices.COMException (0x80010105): 服务器出现意外情况. (异常来自 HRESULT:0x80010105 (RPC_E ...

  2. “System.Runtime.InteropServices.COMException”类型的第一次机会异常在 System.Windows.Forms.dll 中发生

    最近做一个winform项目,在里面用了webbrowser控件进行html文档打印,遇到了标题所示问题.根据查到的一些资料,在调试>异常>查找中输入“System.Runtime.Int ...

  3. “System.Runtime.InteropServices.COMException”类型的第一次机会异常在 ESRI.ArcGIS.Version.dll 中发生

    “System.Runtime.InteropServices.COMException”类型的第一次机会异常在 ESRI.ArcGIS.Version.dll 中发生 其他信息: The speci ...

  4. “System.Runtime.InteropServices.COMException (0x80070422): 无法启动服务”解决方法

    应用程序中发生了无法处理的异常.如果单击“退出”,应用程序将立即关闭.无法启动服务,原因可能是已被禁用或其相关联设备没有启动.(异常来自HRESULT:0X80070422).点击详细内容:有关调用实 ...

  5. System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800AC472

    更新至服务器后运行出错: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800AC472 解决方法 注册 ...

  6. System.Runtime.InteropServices.COMException (0x800706BA) 解决方法

    提示“操作失败:无法获取MAC地址.”错误的解决方法. .NET 获取 MAC地址可能会遇到   System.Runtime.InteropServices.COMException (0x8007 ...

  7. Visual Studio 2008 – ASP.NET “System.Runtime.InteropServices.COMException”

    The Issue When openning an existing ASP.NET project for the first time in Visual Studio 2008 it retu ...

  8. VS2008,System.Runtime.InteropServices.COMException (0x800401F3): Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))

    在VS2008环境中编译调试运行不报错,但在发布的exe文件运行就报错 System.Runtime.InteropServices.COMException (0x800401F3): Invali ...

  9. System.Runtime.InteropServices.COMException (0x800A03EC): 无法访问文件

    使用Microsoft.Office.Interop.Excel 操作 今天在服务器部署,操作程序csv文件转xsl文件的时候,遇到一下问题: System.Runtime.InteropServic ...

  10. System.Runtime.InteropServices.COMException 检索COM类工厂中CLSID{xxxxxxxxx}的组件时失败解决方法

    iis7.5中设定应用程序池中<进程模型>中<标识>为localSystem 提示:System.Runtime.InteropServices.COMException: 命 ...

随机推荐

  1. WEB工程数据库相关安装脚本写作

    1. 数据库oracle安装 2. 数据库用户创建,表空间创建,表创建 #!/bin/bash current_path=`pwd` create_tablespace=${current_path} ...

  2. ISO-7816-1-2-3协议

    第一部分:卡的电气特性一. 卡的触点分配IC卡触点的分配遵循ISO7816-2的规定,如下所示: C1 电源电压(Vcc) C5 地(GND) C2 复位信号(RST) C6 不使用 C3 时钟信号( ...

  3. SVN:分支合并到主干

    合并日志: --- Merging r173674 through r175986 into '.': C src/test/java/com/test/rigel/sandbox/organizat ...

  4. hdu-3487-Play with Chain-(splay 区间翻转,切割,插入)

    题意: 区间翻转,切割,插入 // File Name: ACM/HDU/3487.cpp // Author: Zlbing // Created Time: 2013年08月10日 星期六 21时 ...

  5. 有关linux下redis overcommit_memory的问题(转)

    一.背景 公司的redis有时background save db不成功,通过log发现下面的告警,很可能由它引起的: [13223] 17 Mar 13:18:02.207 # WARNING ov ...

  6. LNMP一键安装脚本

    #!/bin/bash #LNMP(Fastcgi) #CentOS + MySQL 5.5 #-- iptables -F iptables -X iptables -Z iptables -A I ...

  7. 【转】 jni.h头文件详解(二)

    原文网址:http://blog.csdn.net/shaohuazuo/article/details/42932813 作者:左少华 博客:http://blog.csdn.net/shaohua ...

  8. 数据结构(线段树):NOI 2016 区间

    [问题描述] [输入格式] [输出格式] [样例输入] 6 3 3 5 1 2 3 4 2 2 1 5 1 4 [样例输出] 2 [样例说明] [更多样例] 下载 [样例 2 输入输出] 见目录下的 ...

  9. 数学:UVAoj 11174 Stand in a Line

    Problem J Stand in a Line Input: Standard Input Output: Standard Output All the people in the bytela ...

  10. mysql集群安装(centos)

    mysql cluster : 1. 基于NDB Cluster 的分布式数据库系统 2. mysql集群中各服务器节点不共享数据 3. 在mysql cluster中节点指的是进程,区别于其他的集群 ...