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. 「Poetize5」Vani和Cl2捉迷藏

    描述 Description 这片树林里有N座房子,M条有向道路,组成了一张有向无环图.树林里的树非常茂密,足以遮挡视线,但是沿着道路望去,却是视野开阔.如果从房子A沿着路走下去能够到达B,那么在A和 ...

  2. 解决Failed to connect session for conifg 故障

    服务器升级openssh之后jenkins构建报错了,报错信息如下: Failed to connet or change directory jenkins.plugins.publish_over ...

  3. Delphi 弹出Windows风格的选择文件夹对话框, 还可以新建文件夹

    Delphi 弹出Windows风格的选择文件夹对话框, 还可以新建文件夹     unit Unit2; interface uses  Windows, Messages, SysUtils, V ...

  4. 安装ucenter 步骤详解及supesite 安装详解

    最近弄一个 php 的cms  ,花了周六日时间研究了一下,这里记录一下,首先在网页上下载ucenter(分为 gbk 或者utf8版本) 首先下载ucenter 之后,解压之后,upload  里的 ...

  5. FZYZ-2071 A Simple Math Problem IX

    P2071 -- A Simple Math Problem IX 时间限制:1000MS      内存限制:262144KB 状态:Accepted      标签:    数学问题-博弈论    ...

  6. HDOJ 2076 夹角有多大(题目已修改,注意读题)

    Problem Description 时间过的好快,一个学期就这么的过去了,xhd在傻傻的看着表,出于对数据的渴望,突然他想知道这个表的时针和分针的夹角是多少.现在xhd知道的只有时间,请你帮他算出 ...

  7. Jenkins 八: 构建Git项目

    1. 安装git. http://git-scm.com/download/win 下载之后一步步安装即可.   2. 安装插件. 打开"系统管理" –> "管理插 ...

  8. Censored! - POJ 1625(ac自动机+简单dp+高精度运算)

    题目大意:首先给一个字符集合,这个集合有N个字符,然后需要一个长度为M的句子,但是据子里面不能包含的串有P个,每个串里面的字符都是有字符集和里面的字符构成的,现在想知道最多能构造多少个不重复的句子. ...

  9. python数据的存储和持久化操作

    Python的数据持久化操作主要是六类:普通文件.DBM文件.Pickled对象存储.shelve对象存储.对象数据库存储.关系数据库存储. 普通文件不解释了,DBM就是把字符串的键值对存储在文件里: ...

  10. jquery ajaxform上传文件返回不提示信息的问题

    在使用jquery的ajaxform插件进行ajax提交表单并且上传文件的时候,返回类型datatype :json但是后台通过写出一个json对象后,在执行完以后没有进入success函数,而是直接 ...