WPF System.ComponentModel.Win32Exception (0x80004005): Invalid window handle
Asked Answered
D

1

9

I'm getting the following error on WPF. I'm using MVVM databinding to DataContext + CollectionViewSources on the Window. There is too much code in the View Model and View to post, but I'm wondering where to look to find this as no line number comes up.

The window is using WPF databinding with converters, some Telerik controls in there also.

This is after calling

TabItemSelectionEditor.UpdateLayout() 

TabItemSelectionEditor is a System.Windows.Control.TabItem

System.ComponentModel.Win32Exception (0x80004005): Invalid window handle

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.UIElement.UpdateLayout()

at System.Windows.Controls.VirtualizingStackPanel.<>c_DisplayClassb.b_7()

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

Inner Exception is nothing!

Dingbat answered 4/9, 2013 at 12:37 Comment(4)
Anything else to go on--there's really not much there even to guess at. That seems like the stack for handling the exception--not the stack that caused the exception. Is there an inner exception? What that the inner exception?Kenyettakenyon
I've just added a few more details.Dingbat
I'm seeing a very problem and I have no idea where this is coming from: Type: System.ComponentModel.Win32Exception Message: Cannot create a file when that file already exists StackTrace: at MS.Win32.UnsafeNativeMethods.GetWindowText(HandleRef hWnd, StringBuilder lpString, Int32 nMaxCount) at System.Windows.Automation.Peers.WindowAutomationPeer.GetNameCore() ... at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)Graduation
I am seeing exactly same exception as @Volker von Einem. I have no idea why. Anyone has a clue?Yorke
P
0

Do you not have a DisplayClass method in your code?

I can also see that there is a VirtualizingStackPanel involved and the error occurred when it called the UIElement.UpdateLayout() method on its children.

That's about all that I can work out from this error and without any more information, I can't help any further.

Pronate answered 4/9, 2013 at 12:52 Comment(5)
I have a .Show() method on my ViewModel, which created the view and displays it. Is this what you mean by a DisplayClass method?Dingbat
Nope. It was just a guess, but you're saying that you have no class, method, or custom object called DisplayClass anywhere in the application? It was because of the line in the error where it says DisplayClass... this is not a method of the VirtualizingStackPanel class, so I assumed that it was from your code.Pronate
Maybe that is in the Telerik code? As I'm using some Telerik stuff inside that Tab Item.Dingbat
It could well be from Telerik... maybe you should contact them?Pronate
Hey I removed Telerik and switched to built in .NET WPF TabControl and same issue.Dingbat

© 2022 - 2024 — McMap. All rights reserved.