2

我在 Windows 8 上遇到以下异常。但是它适用于 Windows 7 环境。看起来这个异常是由 comctl32.dll 引发的。我已经完成了下面的问题,工具提示与组合框无关。

工具提示上的 AccessViolationException 导致 COMCTL32.dll 出错 - .NET 4.0

应用程序:Application.exe 框架版本:v4.0.30319 描述:进程因未处理的异常而终止。异常信息:System.AccessViolationException

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.Control.DefWndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WmCommand(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ComboBox.WndProc(System.Windows.Forms.Message ByRef)
at CCS.UserInterface.MetaComboBox.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 System.Windows.Forms.Application.Run(System.Windows.Forms.Form)
at <Application>.MainApplication.Load(Splash)
at <Application>.Program.Main(System.String[])

Faulting application name: CCSEnterprise.exe, version: 4.354.4.15321, time stamp: 0x53dfe4c1
Faulting module name: comctl32.dll, version: 6.10.9600.17031, time stamp: 0x5308889d
Exception code: 0xc0000005
Fault offset: 0x00051a6e
Faulting process id: 0x13f8
Faulting application start time: 0x01cfb08bc91cf716
Faulting application path: C:\355AAA\Application.exe
Faulting module path: C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.17031_none_a9efdb8b01377ea7\comctl32.dll
Report Id: 2284a19e-1c7f-11e4-be73-1078d298a609
Faulting package full name: 
Faulting package-relative application ID:
4

2 回答 2

1

我发现这个问题不仅发生在 WPF 中,而且发生在 WinForms 中。很难说问题的根源是什么,但似乎与 OpenFileDialog 相关的 Microsoft dll 有错误(对我来说,是 ComDlg32.dll、OpenFileDialog、ShowDialog() 调用)

我可以调用 ShowDialog() 函数的唯一方法是将它包装在事件中并在

this.BeginInvoke(
        new Action<YourObject, EventArgs>(YourObject_FileDialogOpened), new object[] 
                                                        { YourObjectInstance, e });

其中“this”是一个控件(例如,窗体)。

BeginInvoke(...) 您调用的授权将以适当的方式进行处理。

如果您在按钮单击事件或任何其他类似情况下使用 OpenFileDialog 调用,则不会出现问题。

于 2014-10-09T14:55:52.573 回答
0

我们已经开始遇到同样的问题,但只是从 2016 年 5 月 5 日开始。多年来未触及的客户端安装开始崩溃,并在 comctl32.dll 中出现访问冲突。

事实证明,AVG(防病毒软件)以某种方式导致了这个问题。还有其他论坛和主题报告了类似的问题。

对于我们的应用程序,有两件事起作用;

1) 在 XP SP3 兼容模式下运行(即使在 Windows 8 或 10 上)

或者

2) 禁用 AVG

于 2016-05-16T18:17:54.437 回答