【发布时间】:2011-01-31 20:05:31
【问题描述】:
我正在开发 Outlook 2003 插件。到目前为止,我只使用 winforms 来显示一个表单,但今天我添加了一个 WPF 窗口来处理更复杂的内容。由于 WPF 窗口,Outlook 关闭时会引发 COM 异常。
有人知道为什么吗?我需要在单一公寓状态下为 WPF 窗口启动一个单独的线程。
这是一个例外:
System.Runtime.InteropServices.InvalidComObjectException was unhandled
Message="COM object that has been separated from its underlying RCW cannot be used."
Source="PresentationCore"
StackTrace:
at System.Windows.Input.TextServicesContext.StopTransitoryExtension()
at System.Windows.Input.TextServicesContext.Uninitialize(Boolean appDomainShutdown)
at System.Windows.Input.TextServicesContext.TextServicesContextShutDownListener.OnShutDown(Object target)
at MS.Internal.ShutDownListener.HandleShutDown(Object sender, EventArgs e)
InnerException:
最好的问候,
奥利弗·哈纳皮
【问题讨论】:
标签: .net exception com outlook vsto