TChartSeries OnGetMarkText causing compiler error
Posted: Wed Dec 15, 2010 10:03 pm
I have TeeChart Pro v2010 VCL version installed
I am taking a TChart from an old project using old version of C++ Builder Version 5, and moving it to C++ Builder 2009. The code worked in the old version. When I bring it to the new version I get a compiler error.
// Here's the method in my class
void __fastcall TGraphForm::OnGetMarkText_G(TChartSeries* Sender, int ValueIndex, AnsiString &MarkText)
{
if(Sender->XValues->Value[ValueIndex] > 1.0)
Sender->Marks->BackColor = clRed;
else
Sender->Marks->BackColor = Sender->SeriesColor;
}
// this is a code snippet from another part of the code
// pS is declared as a TChartSeries *
TChartSeries *pS
// later in the code
pS->OnGetMarkText = OnGetMarkText_G;
Here's the compiler error I get:
[BCC32 Error] Graph.cpp(195): E2034 Cannot convert 'void (_fastcall * (_closure )(TChartSeries *,int,AnsiString &))(TChartSeries *,int,AnsiString &)' to 'TSeriesOnGetMarkText'
Any ideas what the problem could be?
I am taking a TChart from an old project using old version of C++ Builder Version 5, and moving it to C++ Builder 2009. The code worked in the old version. When I bring it to the new version I get a compiler error.
// Here's the method in my class
void __fastcall TGraphForm::OnGetMarkText_G(TChartSeries* Sender, int ValueIndex, AnsiString &MarkText)
{
if(Sender->XValues->Value[ValueIndex] > 1.0)
Sender->Marks->BackColor = clRed;
else
Sender->Marks->BackColor = Sender->SeriesColor;
}
// this is a code snippet from another part of the code
// pS is declared as a TChartSeries *
TChartSeries *pS
// later in the code
pS->OnGetMarkText = OnGetMarkText_G;
Here's the compiler error I get:
[BCC32 Error] Graph.cpp(195): E2034 Cannot convert 'void (_fastcall * (_closure )(TChartSeries *,int,AnsiString &))(TChartSeries *,int,AnsiString &)' to 'TSeriesOnGetMarkText'
Any ideas what the problem could be?