I have some trouble with my App, WPF C#.NET 3.5 VS2008, at one customer machine.
My App has nearly 1000 Installation on different windows machines (XP, Vista 32/64, Win7 32/64) and no problem so far.
Only one seems to be have a Problem on a Win7 32 PC.
Task-Manger Overview depending on the current Activity:
1 – Activity: Program started
https://i.stack.imgur.com/jA6j7.gif (See Pic)
2 – Activity: Simple click on a e.g. Menu Item, Button etc
https://i.stack.imgur.com/e0erH.gif (See Pic)
Object USER and Object GDI runs until 10’000 and the App throws the following Exception:
System.ComponentModel.Win32Exception The current process has used all of its system allowance of handles for Window Manager objects
à MS.Win32.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
à MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
à System.Windows.Interop.HwndSource.Initialize(HwndSourceParameters parameters)
à System.Windows.Interop.HwndSource..ctor(HwndSourceParameters parameters)
à System.Windows.Window.SetTaskbarStatus()
à System.Windows.Window.CreateAllStyle()
à System.Windows.Window.CreateSourceWindowImpl()
à System.Windows.Window.SafeCreateWindow()
à System.Windows.Window.ShowHelper(Object booleanBox)
à System.Windows.Window.Show()
à System.Windows.Window.ShowDialog()
à WPFControls.WPFMessageBox.Show(String title, String message, String details, WPFMessageBoxButtons buttonOption, WPFMessageBoxImage image)
à MyApp.Prolog.Application_DispatcherUnhandledException(Object sender, DispatcherUnhandledExceptionEventArgs e)
à System.Windows.Threading.Dispatcher.CatchException(Exception e)
à System.Windows.Threading.Dispatcher.CatchExceptionStatic(Object source, Exception e)
à System.Windows.Threading.ExceptionWrapper.CatchException(Object source, Exception e, Delegate catchHandler)
à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
à System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
à System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
à System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
à MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
à MS.Win32.UnsafeNativeMethods.SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
à System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
à System.Windows.Window.CreateSourceWindowImpl()
à System.Windows.Window.SafeCreateWindow()
à System.Windows.Window.ShowHelper(Object booleanBox)
à System.Windows.Window.Show()
à System.Windows.Window.ShowDialog()
à WPFControls.WPFMessageBox.Show(String title, String message, String details, WPFMessageBoxButtons buttonOption, WPFMessageBoxImage image)
à MyApp.Prolog.Application_DispatcherUnhandledException(Object sender, DispatcherUnhandledExceptionEventArgs e)
à System.Windows.Threading.Dispatcher.CatchException(Exception e)
à System.Windows.Threading.Dispatcher.CatchExceptionStatic(Object source, Exception e)
à System.Windows.Threading.ExceptionWrapper.CatchException(Object source, Exception e, Delegate catchHandler)
à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
à System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
à System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
à System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
à MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
à MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
à System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
à System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
à System.Windows.Window.ShowHelper(Object booleanBox)
à System.Windows.Window.Show()
à System.Windows.Window.ShowDialog()
à MyApp.Prolog.Prolog_Startup(Object sender, StartupEventArgs e) 0 0 0
Please can anyone help ?
UPDATE – EDIT
Our Customer does Setup a new clean (as he said) Win 7 64 OS, but the Problem still exist.
Using WPF Apps seeems to be not working.
I have tried also to use the MVVM Demo App of this Article (msdn.microsoft.com/de-de/magazine/dd419663.aspx) by John Smith at the Customers Machine.
The MVVM Demo App crashes also, when i try i click to a Menu-Item, Button or select something in a DropDown-List. Enter a Text in a Textfield is okay, but click and select does stop the MVVM Demo App with the Error that the Application does not work.
Here a Event-Log of my App
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2013-02-07T11:04:13.000000000Z" />
<EventRecordID>2243</EventRecordID>
<Channel>Application</Channel>
<Computer>RSSec.Machine.local</Computer>
<Security />
</System>
- <EventData>
<Data>MyApp.exe</Data>
<Data>2.0.16.0</Data>
<Data>51136bd8</Data>
<Data>unknown</Data>
<Data>0.0.0.0</Data>
<Data>00000000</Data>
<Data>c000041d</Data>
<Data>74494f0d</Data>
<Data>ecc</Data>
<Data>01ce0522d9d3bc67</Data>
<Data>C:\Program Files (x86)\MyApp\MyApp.exe</Data>
<Data>unknown</Data>
<Data>1ad6d91f-7116-11e2-87c7-10604b689bfe</Data>
</EventData>
</Event>
Can anyone help again ?
Thx
There is at least one problem in your code that’s evident from the stack trace. You’ve written an event handler for the Dispatcher.UnhandledException event and display the exception with a message box. What you do not do is make sure that you avoid doing this if this message box is already displayed. Visible by the multiple appearances of MyApp.Prolog.Application_DispatcherUnhandledException() in the trace.
So there are some odds here that the user is looking at the screen filled with ten thousand message boxes. After which Windows pulled the plug when it refused to allow your program to create any more.
You do not yet know what the real exception looks like. But it is likely to be something gross, something that throws over and over again when the dispatcher loop runs. You’ll need to improve your unhandled exception handling to get the real reason it crashed. Do add a bool flag that indicates that the message box is shown and terminate the program when UnhandledException fires again with the flag set to true. And log the exceptions so you can find out what was thrown without the user having to read back what the message box said.