Page 1 of 1

System.AccessViolationException when user create new chart

Posted: Wed Nov 25, 2015 1:27 pm
by Igor
Hello there,

in my application the user can create a new chart via drag & drop.
So in this process a new chart usercontrol will be created via code. After that i'm setting some property defaults.
This works quite well, but sometimes there appears an exception in the following line of code:

Chart.ViewXY.LegendBox.Visible = true;

"An unhandled exception of type 'System.AccessViolationException' occurred in Arction.Direct3D9.dll"
Additional information: An attempt was made to read the protected memory or write. This is often an indication that other memory is corrupt.

Do you have any idea why this might be?
The exception does not appear, when I comment out this codeline.

Many thanks
Igor

Re: System.AccessViolationException when user create new cha

Posted: Wed Nov 25, 2015 1:38 pm
by ArctionPasi
Sounds like a threading problem. Do you use background threads in the app?

Can you send a small VS project to our support by e-mail, to be able to reproduce the problem?

Re: System.AccessViolationException when user create new cha

Posted: Thu Nov 26, 2015 6:31 am
by Igor
for drag and drop i use the LayoutControl from DevExpress.
Can I use the DevExpress Controls in my example project? Are you able to run the project?

Re: System.AccessViolationException when user create new cha

Posted: Thu Nov 26, 2015 7:55 am
by ArctionPasi
Please strip out all other 3rd party components, such as DevExpress.

Re: System.AccessViolationException when user create new cha

Posted: Mon Nov 30, 2015 11:09 am
by Igor
i couldn't reproduce this problem in a sample project so far.
i'll let you know as soon as i have found out something new.

thank you so far

Re: System.AccessViolationException when user create new cha

Posted: Tue Dec 08, 2015 7:12 am
by Igor
i have solved my problem.
it was indeed a threading problem in combination with to many EndUpdate() and not enough BeginUpdate()-calls.

thanks for the hint