Page 1 of 1

Run time errors - TeeChart 2010 / C++ Builder XE

Posted: Thu Mar 10, 2011 2:33 am
by 16457998
I am working with C++ Builder XE and TeeChart 2010 Pro.

Setting the color of a series at runtime produces an EAccessViolation. I have installed the latest maintenance release today and still have the same problem. I have also found similar errors changing axis properties at runtime. This appears to be specific to C++ Builder and not Delphi.

I tested with a simple app. Created new C++ Builder project with a TChart with a single TLineSeries (Series1). Added a button that uses FillSampleValues to add 25 samples. Then used a second button to change the color:

void __fastcall TForm1::Button2Click(TObject *Sender)
{
Series1->Color = clRed;
}

Running it in debug with a breakpoint at this line, I can see that Series1->Color is 104708548 so there is no problem with any NULL pointers anywhere. After executing the line I get:
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address 01CA3874. Write of address B12946BA'.
---------------------------
Break Continue Help
---------------------------

I created a second simple app exactly the same but with Delphi XE and it works perfectly. Here is the code for that second button:

procedure TForm1.Button2Click(Sender: TObject);
begin
Series1.Color := clRed;
end;

The code is in a very large application that has previously worked with CBuilder5 / TeeChart ? and C++ Builder 2007 / TeeChart8 Pro. I don't want to have to re-write it in Delphi! Please provide me with the solution to this problem (or if I am making a mistake, please tell me where) as it is a really big issue.

Re: Run time errors - TeeChart 2010 / C++ Builder XE

Posted: Tue Mar 15, 2011 3:09 pm
by yeray
Hi Mike,

I've tried to follow your steps with WinXP SP3, RAD Studio XE and TeeChart VCL v2010.02 and I don't reproduce the AV with the application attached.
SeriesColor.zip
(86.23 KiB) Downloaded 636 times
Please, check that TeeChart include path is in the top of your IDE include path and the "Delphi15\Lib" and "Delphi15\Lib\Obj" are on the top of your IDE library path.

Re: Run time errors - TeeChart 2010 / C++ Builder XE

Posted: Tue Mar 15, 2011 9:30 pm
by 16457998
Hi Yeray,
Moving the TeeChart include and library paths to the top of the IDE list has fixed the problem straight away. Thankyou very much for ending a week of frustration!

Re: Run time errors - TeeChart 2010 / C++ Builder XE

Posted: Wed Mar 16, 2011 8:11 am
by yeray
Hi Mike,

You're welcome! :)

Re: Run time errors - TeeChart 2010 / C++ Builder XE

Posted: Fri Mar 18, 2011 11:17 am
by 16458761
check that TeeChart include path is in the top of your IDE include path and the "Delphi15\Lib" and "Delphi15\Lib\Obj" are on the top of your IDE library path.
this action solve the same problem for me, thanks !

Re: Run time errors - TeeChart 2010 / C++ Builder XE

Posted: Mon Mar 21, 2011 9:23 pm
by 10545663
Fixed my issue as well. Wish this would happen automatically on update...