华廷"无法投COM对象"例外 [英] WatiN "Unable to cast COM object" exception

查看:202
本文介绍了华廷"无法投COM对象"例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从时间到的时候,我的监控应用模具没有明显的理由。这似乎是mshtml.HTMLDocument资源不可用。任何人都经历过类似的东西?先谢谢了。

错误消息:

  2011年4月14日18时26分37秒 - >测试1.2(用户类型的请求),错误:无法投型系统.__ ComObject的COM对象的接口类型mshtml.HTMLDocument。此操作失败的原因是对IID{3050F55F-98B5-11CF-BB82-00AA00BDCE0B}接口的COM组件调用QueryInterface失败,原因是以下错误:不支持此接口(异常来自HRESULT:0x80004002(E_NOINTERFACE)) 。

错误堆栈跟踪:

  2011年4月14日18时26分37秒 - >测试1.2(用户类型的请求),追踪:在WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitForFramesToComplete(的IHTMLDocument2 maindocument)
   在WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitForFramesToComplete(的IHTMLDocument2 maindocument)
   在WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitForCompleteOrTimeout()
   在WatiN.Core.WaitForCompleteBase.DoWait()
   在WatiN.Core.IE.WaitForComplete(的Int32 waitForCompleteTimeOut)
   在WatiN.Core.Browser.GoTo(URI URL)
   在WatiN.Core.Browser.GoTo(字符串URL)
   在WebMonitor.Tests.Execute()...


解决方案

感谢您的报告。我已经把一个重试周围的演员。此异常可能是由计时引起的。希望再尝试将修复它。将在下一版本的一部分,或者从SourceForge获得最新的code。

from time to time, my monitoring application dies for no obvious reason. It seems like "mshtml.HTMLDocument" resource isn't available. Anyone else experienced something similar? Thanks in advance.

Error message:

14.04.2011 18:26:37 -> Test 1.2 (Subscriber type requests), error: Unable to cast COM object of type 'System.__ComObject' to interface type 'mshtml.HTMLDocument'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3050F55F-98B5-11CF-BB82-00AA00BDCE0B}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

Error stack trace:

14.04.2011 18:26:37 -> Test 1.2 (Subscriber type requests), trace:    at WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitForFramesToComplete(IHTMLDocument2 maindocument)
   at WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitForFramesToComplete(IHTMLDocument2 maindocument)
   at WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitForCompleteOrTimeout()
   at WatiN.Core.WaitForCompleteBase.DoWait()
   at WatiN.Core.IE.WaitForComplete(Int32 waitForCompleteTimeOut)
   at WatiN.Core.Browser.GoTo(Uri url)
   at WatiN.Core.Browser.GoTo(String url)
   at WebMonitor.Tests.Execute() ...

解决方案

Thanks for reporting. I have put a a re-try around the cast. This exception is probably caused by timing. Hope the re-try will fix it. Will be part of the next release or get the latest code from SourceForge.

这篇关于华廷"无法投COM对象"例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆