AccessViolationException的工具提示,故障COMCTL32.DLL - .NET 4.0 [英] AccessViolationException on ToolTip that faults COMCTL32.dll - .NET 4.0

查看:961
本文介绍了AccessViolationException的工具提示,故障COMCTL32.DLL - .NET 4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们是有一个问题,我们的Windows窗体应用程序在那里终止由于未处理的异常类型AccessViolationException的堆栈跟踪,指示出现工具提示控制范围之内。

We are having an issue with our Windows forms application where it is terminating due to an unhandled exception of type AccessViolationException that the stack trace is indicating occurs within the ToolTip control.

该错误发生在应用程序中不同的时间,而我们目前无法可靠地重现它。 在这个阶段,它的发生是在生产上Windows 7和只对一些用户,而不是其他人 - 即使之间使用以类似的方式应用的用户。 这似乎是机器相关的,所以我们做了一些事情,如确保显卡驱动程序是最新的。

The error occurs at different times in the application, and we are currently not able to reliably reproduce it. At this stage it is occurring only in production on Windows 7 and only for some users, but not others – even amongst users that use the application in a similar way. It appears to be machine related and so we have done things like ensure the graphics driver is up to date.

在事件日志中,总有2个不同的错误记录下来,一个涉及到我们的应用程序:

In the event log, there are always 2 different errors logged, one relating to our application:

Application: <Application>.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)
   at System.Windows.Forms.NativeWindow.DefWndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ToolTip.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ToolTip+ToolTipNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
   at System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
   at <Company>.Windows.Forms.<Application>.Startup.Main(System.String[])

和一个涉及COMCTL32.DLL:

And one relating to comctl32.dll:

Faulting application name: <Application>.exe, version: 7.13.0.2086, time stamp: 0x4ec5e710
Faulting module name: comctl32.dll, version: 5.82.7601.17514, time stamp: 0x4ce7b82c
Exception code: 0xc0000005
Fault offset: 0x00043286
Faulting process id: 0xcdc
Faulting application start time: 0x01cca96312446309
Faulting application path: C:\Program Files\<Company>\Client\<Application>.exe
Faulting module path: C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll
Report Id: b425143c-1575-11e1-bccf-6c626d955bf1

不同的地方在发生错误的工作流程,然而,前9个项目在堆栈上总是相同的第一个堆栈跟踪变化,所不同的,通常是出现在main()方法和之间的ShowDialog电话RunMessageLoop方法。例如:

The first stack trace changes depending on where in the workflow the error occurs, however, the top 9 items on the stack are always the same, the difference is usually a showDialog call that appears in between the Main() method and the RunMessageLoop method. E.g.:

Application: <Application>.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
   at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)
   at System.Windows.Forms.NativeWindow.DefWndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ToolTip.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ToolTip+ToolTipNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
   at System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
   at System.Windows.Forms.Application.RunDialog(System.Windows.Forms.Form)
   at System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window)
   at System.Windows.Forms.Form.ShowDialog()
   at <Company>.Windows.Forms.<Application>.ApplicationForm.<EventSubscribingMethod>(System.Object, System.EventArgs)
   at <Company>.<Application>.<Class1>.RaiseShowResultDialogNowEvent()
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(System.Object)
   at System.Threading.ExecutionContext.runTryCode(System.Object)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
   at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Form.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
   at System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
   at <Company>.Windows.Forms.<Application>.Portal.Startup.Main(System.String[])

----更新----

---- Update ----

我有一个请求,其中包括一些从主要的code,我不希望包括所有code,但提取的是:

I have had a request to include some of the code from Main, I don't want to include all code, but an extract is:

 <System.STAThread()> _
    Public Shared Function Main(ByVal args() As String) As Integer
        -- Perform startup validation, setup logging framework, etc
        ...
        Dim appLife as new ApplicationContext(myStartupForm)
        Application.Run(appLife)
        Return 0

    End Function

一些其他注意事项:

Some additional notes:

  • 我们正在使用的用户界面处理应用程序块从微软模式与实践
  • 我们不覆盖的WndProc一对夫妇的控制,包括CheckBoxComboBox从code项目,<一个href="http://www.$c$cproject.com/KB/combobox/extending_combobox.aspx">http://www.$c$cproject.com/KB/combobox/extending_combobox.aspx

有谁知道什么引起的?

谢谢

推荐答案

据MS,有一个已知的问题与DataGrid控件在某些情况下,为了避免这个问题的方法是禁用的工具提示为您的DataGrid控件。

According to MS, there is a known issue with the DataGrid control in certain situations, and the way to avoid this issue is to disable Tooltips for your DataGrid controls.

我们将在实施变更和滚动它在未来几天的试验组,我会后回来的成功/失败在一个星期左右(当然,除非故障在此之前发生的)。

We will be implementing the change and rolling it out to a pilot group in the next couple of days, I'll post back with success/failure in about a week (unless of course failure happens before then).

属性根据MS是集 DataGridView.ShowCellToolTips = FALSE;

这固定的问题为我们的应用程序。

This fixed the issue for our application.

要重现该问题,我们需要做到以下几点:

To reproduce the issue, we needed to do the following:

  • 将鼠标悬停在我们DataGridView中的单元格,我们知道会显示一个提示
  • 替代选项卡到另一个应用程序(这将显示在您的应用程序的顶部)工具提示之前显示
  • 请不要移动鼠标
  • 替代选项卡返回到程序
  • 在我们的应用程序崩溃。

这篇关于AccessViolationException的工具提示,故障COMCTL32.DLL - .NET 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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