zoukankan      html  css  js  c++  java
  • WPF 问题 PresentationCore.dll!System.Windows.Media.Composition.DUCE.Channel.SyncFlush() 分析

    错误信息:

    没有足够的内存继续执行程序
    
    在 System.Windows.Media.Composition.DUCE.Channel.SyncFlush()
       在 System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet)
       在 System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam)
       在 System.Windows.Interop.HwndTarget.OnWindowPosChanging(IntPtr lParam)
       在 System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
       在 System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

    我们认为这个问题也可能与硬件有关,并且它可能不会出现在不同的视频卡的机器上。

    通过禁用硬件加速来检查它,并在应用程序中的主窗体的加载事件处理程序中放置以下代码:

    var hwnd_source = (System.Windows.Interop.HwndSource)PresentationSource.FromVisual(this);
    var hwnd_target = hwnd_source.CompositionTarget;
    hwnd_target.RenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;

    禁用后,不会出现问题了,可能是硬件问题!

    有待解决...................

  • 相关阅读:
    从代码书写理解指针,很重要
    指针参数 引用参数
    [转载]c/c++ 操作sqlite
    [转载]C#.NET DataTable扩展 ToList/Get/OrderBy/Where/ToPage
    [转载]宏定义
    【转载】scanf,sscanf高级用法
    C开发机顶盒实战应用代码片段
    指针精华口诀,短小精悍
    C# linq泛型 字典集合 排序
    c开发机顶盒实战应用代码片段2
  • 原文地址:https://www.cnblogs.com/tianciliangen/p/9262116.html
Copyright © 2011-2022 走看看