0
我有windows.forms應用程序在按鈕單擊事件處理程序上創建WPF窗口。它調用WPF窗口實例上的「Show」方法。當父窗口的窗口位置被改變時,WPF窗口開始偵聽父窗口事件並嘗試調整自身的大小(設置左,頂,寬,高屬性)(WPF窗口在視覺上跟隨Windows.Forms窗口,因爲它是固定)。WPF:Windows窗體應用程序交互導致奇怪的錯誤
一切工作正常,但由於某種原因,我偶爾會收到SEH exception was unhandled
彈出窗口:
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm) ...
看來不時,很難找出什麼我做錯了。
我也注意到,WPF窗口和Windows.Forms窗口運行在不同的線程上。
任何想法?