我正在開發一個使用棱鏡框架[.net 4.0]的wpf應用程序。我使用StockTrader RI中的RegionPopupBehavior實現了一個彈出窗口。現在,當我關閉主窗口,或者使用在窗口的標題欄[主窗口]的右上角的關閉按鈕,或者點擊一個按鈕使用WPF使用PopupRegion的Prism應用程序在關閉時拋出無效的窗口句柄
Application.Current.Shutdown()
電話,我得到的消息的win32異常「無效的窗口處理「,堆棧跟蹤是所有互操作調用返回到應用程序的Run()調用。
我有搜索谷歌和所以沒有用的答案。我在關閉期間設置了中斷並檢查了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