我创建了一个运行相当稳定的 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 的错误。我已经在寻找获取窗口文本()方法没有成功。唯一的thread https://stackoverflow.com/questions/18614011/wpf-system-componentmodel-win32exception-0x80004005-invalid-window-handle这里在 StackOverFlow 上引用相同的异常也无法帮助我。
希望有人能给我一些为什么会发生这种异常的原因。
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)