2011-12-01 82 views
14

で発生しています。スタックトレースがToolTipコントロール内で発生していることを示すAccessViolationException型の未処理例外のため、終了するWindowsフォームアプリケーションに問題があります。AccessViolationExceptionは、ツールチップヒントCOMCTL32.dll - .NET 4.0

エラーはアプリケーションのさまざまな時点で発生し、現在は確実に再現することができません。 この段階では、Windows 7のプロダクションでのみ発生しますが、一部のユーザーでは、他のアプリケーションでは発生しません。同様の方法でアプリケーションを使用するユーザーの間でも発生します。 これはマシンに関連しているようですので、グラフィックスドライバが最新のものであることを確認しています。イベントログに

、2つの異なるエラーが常に存在している1は、我々のアプリケーションに関連して、ログイン:

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に関連する1:

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()メソッドとRunMessageLoopメソッドの間に表示されるshowDialog呼び出しです。例:

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[]) 

----更新----

私は主からのコードの一部を含むように要求があった、私はすべてのコードを含めることはありませんが、抽出物があります:

<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 

いくつかの追加の注意事項:

でコードプロジェクトからCheckBoxComboBox含め、コントロールのカップルでWndProcメソッドをオーバーライドしていますか?

おかげで、

+0

ですが、メイン '内のコードを表示します()'してください。 'Application.Run'を呼び出さないようです。 – leppie

+0

余分な情報をありがとう。 '0xc0000005'はネイティブの' NullReferenceException'です。あなたが 'WndProc'をオーバーライドしていると言っているので、私はヌルポインターがあると思われます。 – leppie

答えて

21

はMSによると、特定の状況では、DataGridコントロールの既知の問題があり、この問題を回避する方法は、お使いのDataGridコントロールのツールチップを無効にすることです。

今後数日間に変更をパイロットグループに導入する予定です。私は、約1週間で成功/失敗を返信します。

MSに応じて設定するプロパティは、これが私たちのアプリケーションの問題を修正しDataGridView.ShowCellToolTips = false;

です。

  • ホバーは、我々は、ツールチップを表示することを知っていた私たちのDataGridViewのセルの上にマウス
  • が別のアプリケーションに
  • Altキー]タブ(それが表示されます。

    問題を再現するために、我々は次の操作を行うために必要なあなたのアプリケーションの上に)ツールヒントが

  • 示される前に戻って我々のアプリケーション
  • 当社のアプリケーションのクラッシュにマウス
  • Altキー]タブを移動しないでください。
+0

うわー!私は最終的に私の問題を複製することができましたhttp://stackoverflow.com/q/7458915/68936あなたの答えに感謝!それは、すべてのdatagridviewのツールチップを無効にする必要がありますが、私が想定しているアクセス違反よりも優れています。参照URLがあると思いますか?「MSに従う」とは、私的な会話を通じて情報を得たということですか?あなたの答えを投稿してくれてありがとう。 – Jimmy

+1

こんにちはジミー、私は有料のサポートを通じて答えを得ました。残念なことに、彼らが私にポイントすることができる公式KBはありませんでした。私はこれがあなたを助けてくれてうれしいです:-) – Sean

+0

私はあなたに昼食を借りています..この素晴らしい答えのおかげで多く。私はそれをすべて見つけることができたあなたの礼儀のために今日も何も出てこなかったことを見つけるのに2週間かかりました。どうやって同じことを知りましたか? – Dhananjay

10

Form.DeactivateDataGridView.ShowCellToolTips = falseを設定すると、クラッシュを防ぎようです。 Form.Activateで真にリセットできます。

ただし、新しくフォーカスを当てたウィンドウの上にツールチップが表示されますが、クラッシュする方が良いでしょう。

あるいはさらに良い:visualスタイルが有効になっていないとき

問題が発生します。

Application.EnableVisualStyles()main()に追加すると、フォームがインスタンス化される前に問題が解決されます。

+0

Application.EnableVisualStyles()を設定して問題を解決したことを確認しました – Jimmy

関連する問題