Jump to content
Software FX Community

Access violation error


Recommended Posts

Dear Sirs,

My managed application is using Cfx Client Server 6.2 through COM interop. It sometimes closes with an Access violation error. Managed stacktrace looks like this:

Using WinDbg, I have found that the exception happens in ChartFX.ClientServer.Core.dll:

Unmanaged stack is shown like this (although it may be incorrect since I don't have debug info):

Can you tell me if it's possible to find out which .dll function gets called in that moment( in the COM dll)? 
This usually happens when switching tabs, so I guess it happens during repaint.I hope that by finding this I could narrow the problem (I am using constant lines, regions,multiple axes+panes, filled area between series, lots of stuff), so I hope that it may at leastbring me closer to the point of fault. 
Link to comment
Share on other sites


I have added the PrePaint, GetAxisLabel and PostPaint event handlers to see what gets executed, and I can see that when the exception is thrown, only PrePaint gets fired.

In other cases, all three events are fired. The exception happens sometimes when I am switching tab pages in my form, just before the chart is painted.

Link to comment
Share on other sites

I found out that this happens if I try to use Axis.Zoom(min, max) or Axis.SetScrollView(min, max), before Chart starts to actually paint itself. It then crashes on next repaint.

If I set the axis zoom after the PostPaint event, it will flicker once before it's zoomed, so is there another way I can set the axis zoom programatically, before the chart is painted?


Link to comment
Share on other sites

I am sending a simple Test app, hoping that someone will finally reply. It's a .NET C# app using Cfx Client Server 6.2.

public Form1()
  this.Load += new EventHandler(Form1_Load);

void UpdateChart()
  // clear chart

  // fill list data provider with some data
  ListDataProviderClass listProvider = new ListDataProviderClass();
  object xAxisData = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
  object yAxisData = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
  listProvider.AddCollection(ref xAxisData);
  listProvider.AddCollection(ref yAxisData);

  // enable data editor
  chart.DataEditor = true;

  // bind
  chart.DataSource = listProvider;

  // zoom programatically
  chart.Zoom = true;
  chart.AxisX.Zoom(2, 8);
  chart.AxisY.Zoom(2, 8);

void Form1_Load(object sender, EventArgs e)
  // call it twice

Note that I am deliberately calling the code twice, before it gets painted. Our app has an interface where user can select lots of data from a tree-view and in some cases, when chart is updated before it gets time to repaint, then it crashes with an access violation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...