ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  chartdir51 for C++ crashing on makechart function in BaseChart
Posted by Vedavyas V Hegde on Jan-15-2015 17:45
Attachments:
Hi,

   We are using the C++ chartdirector in our mfc applicaion, which has got crashed on
makechart function in Basechart class. the relevent screen shot for the perticular call stack
is attached.

Can You Please suggest why is that crash is happened and what might be the reason
for it and if so what would be the solution

Thank You,
Regards,
Vedavyasa V Hegde
Chartdir51_crash.png

  Re: chartdir51 for C++ crashing on makechart function in BaseChart
Posted by Peter Kwan on Jan-16-2015 01:40
Hi Vedavyas,

In C++, there are many reasons why the code can crash. One of the most common reason
is corrupted or invalid memory. For example, the FinanceChart object can be corrupted
(such as being deleted), or its memory are corrupted by other unrelated variables (such as
by writing to memory exceed the bounds of the variables). This applies not only to the
FinanceChart object that you are using, but also to objects you may have added to the
various XYCharts (the main price chart, indicator charts, etc) that you may have added to
the FinanceChart.

Another common reason is due to invalid data. For example, the data pointers or string
points passed to ChartDirector can point to invalid positions (or point to memory that have
already been deleted), or the various parameters are unreasonable (such as creating a
chart that is 1000000 x 1000000 in size by mistake, or using a font which is 100000 pts in
size, or a line with line width of 100000 pixels, etc).

To diagnose the problem, it is best to start with some code that works. For your case, do
you have a version of the code that does not crash? (Is it the first time you compile and
run ChartDirector in your code? If not, you may have a version that does not crash.) You
can perform the modiciation of that code until it crashes. This can help to identify the
cause of the problem.

Another method is to start with a sample code that come with ChartDirector (which should
work), then try to modify it until it crashes. You can then send me the modified sample
code to help me reproduce and diagnose the problem.

Regards
Peter Kwan