【问题标题】:Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar) exception when refreshing WebBrowser object刷新 WebBrowser 对象时出现 Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar) 异常
【发布时间】:2016-01-28 23:21:28
【问题描述】:

我们有一个运行 Microsoft CE v6.0 的设备,其应用程序在我认为是 .NET 2.5 下运行。

通过使用WebBrowser 对象和本地存储的html 页面,我们有一种特殊的方式在设备的屏幕上显示一些信息。

基本上我们这样做:

//Create a WebBrowser object
public WebBrowser htmlUserText = new WebBrowser(); // Initialization in main form
SetupInternalControl(htmlUserText, pnlCenterDisplay); 


// Set up a default html file and point the web browser at it. 
htmlFile = new StreamWriter("\\Temp\\HtmlText.html");
htmlFile.Write("<html><body scroll=no bgcolor = #646464><font color = #FFFFFF>");
htmlFile.Close();
htmlUserText.Navigate(new Uri("\\Temp\\HtmlText.html")); // This is a constant file we create some default stuff in it. 
htmlUserText.Visible = false;

// At some point we can write some html to the file and after it is closed we do this:
htmlUserText.Refresh();
htmlUserText.Visible = true;
htmlUserText.BringToFront();

windows ce以前版本的影响,就是网页显示出来了:

这是一个示例 html 文件和结果:

<html><body scroll=no bgcolor = #646464><font color = #FFFFFF>lalalalalalala

然而,当我尝试同样的事情时,我得到一个 Exception 并带有以下堆栈跟踪:

>Error
>Exception
>at
>Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar)
>at
>System.Windows.Forms.WebBrowser.Refresh()
>at ....

我读过类似this 之类的问题,但我的问题似乎是这次刷新所特有的,我不熟悉其余的代码和资源已打开/未清理。我也见过this,但忽略脚本错误不会做任何事情。

我无法单步执行代码,因为它在外部设备上运行并且与我的电脑没有连接。当我在 try catch 周围 refresh() 行我得到一个异常但它根本没有帮助,它没有内部异常并且消息只是 "Exception"

  1. 这些代码的实现方式有什么明显不好的地方吗?我知道这可能不是最佳选择,但如果我不需要,我不想更改遗留代码。
  2. 我如何才能获得更多关于为什么会发生这种情况的详细信息,以便我可以追踪它?

即使删除刷新并导航到并显示页面,我们也不会抛出异常但网页没有显示,我们只是得到一个白色背景,里面什么都没有。

【问题讨论】:

    标签: c# windows-ce


    【解决方案1】:

    结果证明这是一个非常误导性的错误。

    运行 CE 的产品是 KEBA keTop Pendant。 KEBA 在他们的机器上为 CE 发布了不同的固件和操作系统版本。升级挂件时,我从 1.2 PRO 升级到 1.3 Standard。 标准版不包括 Internet Explorer。据我所知,IE 在查看网页时很重要(讽刺)。

    这里的解决方案是升级到 1.4 PRO。

    有趣的是,WebBrowser 异常并不知道 IE 丢失的事实。

    【讨论】:

      猜你喜欢
      • 2012-11-09
      • 2015-04-23
      • 1970-01-01
      • 1970-01-01
      • 2014-03-17
      • 1970-01-01
      • 2015-03-20
      • 2011-10-24
      • 1970-01-01
      相关资源
      最近更新 更多