System.AccessViolationException when user create new chart

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
Igor
Posts: 67
Joined: Mon Sep 28, 2015 1:14 pm

System.AccessViolationException when user create new chart

Post by Igor » Wed Nov 25, 2015 1:27 pm

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

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: System.AccessViolationException when user create new cha

Post by ArctionPasi » Wed Nov 25, 2015 1:38 pm

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?
LightningChart Support Team, PT

Igor
Posts: 67
Joined: Mon Sep 28, 2015 1:14 pm

Re: System.AccessViolationException when user create new cha

Post by Igor » Thu Nov 26, 2015 6:31 am

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?

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: System.AccessViolationException when user create new cha

Post by ArctionPasi » Thu Nov 26, 2015 7:55 am

Please strip out all other 3rd party components, such as DevExpress.
LightningChart Support Team, PT

Igor
Posts: 67
Joined: Mon Sep 28, 2015 1:14 pm

Re: System.AccessViolationException when user create new cha

Post by Igor » Mon Nov 30, 2015 11:09 am

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

Igor
Posts: 67
Joined: Mon Sep 28, 2015 1:14 pm

Re: System.AccessViolationException when user create new cha

Post by Igor » Tue Dec 08, 2015 7:12 am

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

Post Reply