AccessViolationException when clicking on user control
Posted: 17 Feb 2023, 17:01
I'm getting the following exception when clicking on a user control that is dynamically added to a tab item:
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Noesis.View.Noesis_View_MouseButtonDown(HandleRef view, Int32 x, Int32 y, Int32 button)
at NoesisApp.Window.OnDisplayMouseButtonDown(Display display, Int32 x, Int32 y, MouseButton button)
at NoesisApp.Win32Display.DispatchEvent(UInt32 msg, IntPtr wParam, IntPtr lParam)
at NoesisApp.Win32Display.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
at NoesisApp.Win32Display.WinApi.DispatchMessage(Message& lpMsg)
at NoesisApp.Win32Display.EnterMessageLoop(Boolean runInBackground)
at NoesisApp.Application.Run()
I'm not sure what is causing this or how to debug it. I have no code that handles a mouse down event on my side.
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Noesis.View.Noesis_View_MouseButtonDown(HandleRef view, Int32 x, Int32 y, Int32 button)
at NoesisApp.Window.OnDisplayMouseButtonDown(Display display, Int32 x, Int32 y, MouseButton button)
at NoesisApp.Win32Display.DispatchEvent(UInt32 msg, IntPtr wParam, IntPtr lParam)
at NoesisApp.Win32Display.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
at NoesisApp.Win32Display.WinApi.DispatchMessage(Message& lpMsg)
at NoesisApp.Win32Display.EnterMessageLoop(Boolean runInBackground)
at NoesisApp.Application.Run()
I'm not sure what is causing this or how to debug it. I have no code that handles a mouse down event on my side.