zoukankan      html  css  js  c++  java
  • WP8异常错误:Error HRESULT E_FAIL has been returned from a call to a COM component.

    在做WP8开发的过程中,使用到了longlistselector这个控件,本来使用没有问题。

    但是突然出现了一个闪退的错误,错误信息如下:

    {MS.Internal.WrappedException: Error HRESULT E_FAIL has been returned from a call to a COM component. ---> System.Exception: Error HRESULT E_FAIL has been returned from a call to a COM component.
    at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
    at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize)
    at System.Windows.UIElement.Measure(Size availableSize)
    at Microsoft.Phone.Controls.LongListSelector.RealizeDisplayItem(Iterator`1 iterator, RealizeOptions options)
    at Microsoft.Phone.Controls.LongListSelector.RealizedRange.Append(RealizedRange nextRange, Double bottom)
    at Microsoft.Phone.Controls.LongListSelector.AppendElement(RealizedRange range, RealizedRange nextRange, Double bottom)
    at Microsoft.Phone.Controls.LongListSelector.HealElements(Rect requireRect, Rect allowRect, Boolean& areBoundsUpdated)
    at Microsoft.Phone.Controls.LongListSelector.Balance()
    at Microsoft.Phone.Controls.LongListSelector.MeasureOverride(Size availableSize)
    at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)
    --- End of inner exception stack trace ---}

    看似很复杂,搞得我也不知道从何下手。

    回想整个开发过程,之前使用正常,后面闪退,期间做了全局资源命名的调整,但是vs没有给出错误提示,本以为替换完毕(其实应该全局查找替换的)。

    但遗漏了一个地方,longlistselector中的HeaderDataTemplate中的一个资源使用的地方。

    在做了更改后,使用又恢复正常了。

  • 相关阅读:
    Python 文件操作
    Python 操作 sqlite
    Python中的random模块
    Linux系统下的/etc/nsswitch.conf文件
    Python 列表/元组/字典总结
    快斗之翼:python2的print和python3的print()
    田小计划:图解Python深拷贝和浅拷贝
    Python 自省指南
    Python运算符优先级
    tc: 模拟网络异常的工具
  • 原文地址:https://www.cnblogs.com/wangzhiyu811/p/3601829.html
Copyright © 2011-2022 走看看