ArcGIS “Error HRESULT E_FAIL has been returned from a call to a COM component.” 异常的解决

简介:

错误提示内容:

{System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at ESRI.ArcGIS.Display.AlgorithmicColorRampClass.CreateRamp(Boolean& ok) ...


 写了一个简单的函数:

复制代码
public IColorRamp CreateColorRamp(IColor fromColor, IColor toColor, int count)
{
  IAlgorithmicColorRamp pRampColor;
  bool ok = true;

  pRampColor = new AlgorithmicColorRampClass();
  pRampColor.FromColor = fromColor;
  pRampColor.ToColor = toColor;
    // ... missing size sentence 
  pRampColor.CreateRamp(out ok);

  return pRampColor as IColorRamp;
}
复制代码

 

后来仔细检查代码,发现在以上黄色语句处少了pRampColor.Size = count;这句话,导致创建彩色条带的失败。但是仅仅给出“Error HRESULT E_FAIL has been returned from a call to a COM component.”这样的错误,我对ArcGIS的异常提示也是醉了,鬼知道这是什么错误。所以说在不考虑ArcGIS那几处优秀的设计地方外,可以说ArcGIS这个系统软件做的十分烂。

备注一下,省的以后再被ArcGIS这样的错误弄的一头雾水。

 

没有整理与归纳的知识,一文不值!高度概括与梳理的知识,才是自己真正的知识与技能。 永远不要让自己的自由、好奇、充满创造力的想法被现实的框架所束缚,让创造力自由成长吧! 多花时间,关心他(她)人,正如别人所关心你的。理想的腾飞与实现,没有别人的支持与帮助,是万万不能的。



    本文转自wenglabs博客园博客,原文链接:http://www.cnblogs.com/arxive/p/6843543.html ,如需转载请自行联系原作者
相关文章
|
5月前
Failed to execute script ‘xxx‘ due to unhandled exception:No module named ‘ctypes‘
Failed to execute script ‘xxx‘ due to unhandled exception:No module named ‘ctypes‘
130 0
|
6月前
|
Web App开发 前端开发
【前端异常】Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
【前端异常】Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
463 0
|
4月前
|
JavaScript 安全 网络安全
Node: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]异常处理
Node: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]异常处理
454 0
|
8月前
|
Java Maven Android开发
成功解决FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE
成功解决FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE
|
4月前
|
编译器 Serverless Go
Fail to start function, Code:1
Fail to start function, Code:1
27 2
|
9月前
|
SQL 并行计算 数据库连接
ArcSWAT报错:Error Number :-2147467259; 对 COM 组件的调用返回了错误 HRESULT E_FAIL
ArcSWAT报错:Error Number :-2147467259; 对 COM 组件的调用返回了错误 HRESULT E_FAIL
|
10月前
|
关系型数据库 MySQL C++
Error:error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
Error:error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
123 0
|
11月前
|
计算机视觉
【在虚拟环境下完美解决】1698: error: (-215:Assertion failed) empty() in function cv::CascadeClassifier
首先我们要找到那个分类器所在的路径,我们可以在Cmd中直接输入【若是虚拟环境的话,则需要切换到对于虚拟环境中,再去查找对应的opencv版本与位置信息】
218 0
|
Java Android开发
Bad method handle type 7异常解决
在利用androidx版本写demo时,在添加了一些依赖后,遇到了`java.lang.ClassNotFoundException`bug,这就很奇怪了,我就添加rxjava3的依赖,就给我报这个错误。