0

I have an application built with WPF using .Net framework 4.8 and windows APIs which runs as a windows application and opens an excel app (separate excel process) and from the excel app opens up a VSTO built using WPF which opens up another window, with in that window there is a functionality to open another window on top.
This workflow works fine for most of the users and environment, but sometime the application crashes intermittently for some users.
when I checked for the error I could find a trace of error in event viewer with below details

.NET Runtime: Application: appname.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.ComponentModel.Win32Exception at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean, System.Nullable`1) at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr) at System.Windows.Interop.HwndTarget.HandleMessage(MS.Internal.Interop.WindowMessage, IntPtr, IntPtr) at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

I tried running and debugging but unfortunately I am not able to reproduce or pinpoint the exact root cause of the issue as the error above doesn't specify exactly what is triggering this error and though I am using windows API to adjust the size and position of the window but not directly using UpdateWindowPos or UpdateWindowSettings from the windows API.

I am kind stuck at the issue and would like some advice or direction to go forward.

2
  • The error is way too generic, there's no way we can help w/o a reproducing project/sample code. Places to look in priority: interop (custom native .dll, COM, DllImport etc.) & multi threading. Commented Apr 15 at 14:52
  • as @SimonMourier stated, without sample code it is difficult to pin point the issue. My best guess with the information would be an invalid or null parameter being passed when you are adjusting the size/position of a window. If you ensure your symbol files (.pbd) files are in the application directory, you may get line numbers as to where exactly in your code the invalid call is being made Commented Apr 15 at 22:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.