5

我创建了一个运行非常稳定的 WPF 应用程序。但是有一个问题我无法解决。

当我通过 TeamViewer(版本 11)连接到运行 WPF 应用程序(全屏模式)的平板电脑时,应用程序崩溃。当我结束远程连接时也会发生同样的情况。

我得到以下异常:

System.ComponentModel.Win32Exception (0x80004005): Cannot create a file when that file already exists
at MS.Win32.UnsafeNativeMethods.GetWindowText(HandleRef hWnd, StringBuilder lpString, Int32 nMaxCount)
at System.Windows.Automation.Peers.WindowAutomationPeer.GetNameCore()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.ContextLayoutManager.fireAutomationEvents()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

我认为问题出在我的代码中,而不是 TeamViewer 的错误。我已经在搜索GetWindowText()方法但没有成功。StackOverFlow 上唯一引用相同异常的线程也无法帮助我。

希望有人能给我一些为什么会发生这种异常的原因。

4

0 回答 0