Run time errors - TeeChart 2010 / C++ Builder XE
Posted: Thu Mar 10, 2011 2:33 am
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.
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.