voula_d
Topic Author
Posts: 21
Joined: 16 Feb 2023, 17:40

AccessViolationException when clicking on user control

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.
Last edited by voula_d on 22 Feb 2023, 17:05, edited 1 time in total.
 
User avatar
jsantos
Site Admin
Posts: 4825
Joined: 20 Jan 2012, 17:18
Contact:

Re: AccessViolationException when clicking on user control

20 Feb 2023, 12:13

Are you able to reproduce this in one of our examples? If so, please, let us know the steps.
 
voula_d
Topic Author
Posts: 21
Joined: 16 Feb 2023, 17:40

Re: AccessViolationException when clicking on user control

22 Feb 2023, 17:16

I can't find an example that dynamically adds a user control and I cannot reproduce the problem in any other case. I'm adding a control to a canvas by dynamically parsing xaml. Could you point me to a possible reason why this kind of error could be thrown?
 
User avatar
sfernandez
Site Admin
Posts: 3364
Joined: 22 Dec 2011, 19:20

Re: AccessViolationException when clicking on user control

23 Feb 2023, 12:00

I guess this is related to your other post, could you please create a ticket in our bugtracker and share an example projet that reproduces the crash?
 
voula_d
Topic Author
Posts: 21
Joined: 16 Feb 2023, 17:40

Re: AccessViolationException when clicking on user control

23 Feb 2023, 17:17

I tried reproducing the error using a simpler sample application but unfortunately it was not reproducible. I can only reproduce it on my application which I cannot share. I can't think of any other way to point you to a reproducible scenario, I guess I have to keep trying.
I found another issue with Dispatcher.BeginInvoke however that could be related. I just posted a ticket for that
https://www.noesisengine.com/bugs/view.php?id=2522

Who is online

Users browsing this forum: Bing [Bot] and 3 guests