プリズムフレームワーク[.net4.0]を使用してwpfアプリケーションを開発しています。StockTraderRIのRegionPopupBehaviorを使用してポップアップウィンドウを実装しました。これで、メインウィンドウを閉じるときに、ウィンドウタイトルバー[メインウィンドウ]の右上にある閉じるボタンを使用するか、
Application.Current.Shutdown()
ボタンクリックで呼び出すと、「Invalid Window Handle」というメッセージが表示されたwin32例外が発生し、スタックトレースはアプリのRun()呼び出しへのすべての相互運用呼び出しです。
私は無駄への答えをグーグルとSOで検索しています。閉じるときにブレークを設定してWindowsコレクションを確認しましたが、メインウィンドウがアクティブとして表示されるだけです[ポップアップが非表示の場合]。閉じるを押すと、ポップアップウィンドウが開いているかどうかに関係なくエラーが発生することに注意してください。
スタックトレースは次のとおりです。
at MS.Win32.HwndWrapper.DestroyWindow(Object args)
at MS.Win32.HwndWrapper.Dispose(Boolean disposing, Boolean isHwndBeingDestroyed)
at MS.Win32.HwndWrapper.Dispose()
at System.Windows.Interop.HwndSource.Dispose(Boolean disposing)
at System.Windows.Interop.HwndSource.WeakEventDispatcherShutdown.OnShutdownFinished(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Threading.Dispatcher.ShutdownImplInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.Dispatcher.ShutdownImpl()
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at RNDGroup.App.App.Main() in c:\Users\jgilliland\Projects\Common\Source\Prism GUI\RNDGroup.App\obj\x86\Release\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
私の質問は、誰かが以前に同様の状況でそれを見た場合、どうすればこれを修正できるか、またはこのwin32例外をさらにデバッグするにはどうすればよいですか?ありがとう、j