TChartSeries OnGetMarkText causing compiler error

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
MaryM
Newbie
Newbie
Posts: 12
Joined: Tue Jun 15, 2010 12:00 am

TChartSeries OnGetMarkText causing compiler error

Post by MaryM » 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?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TChartSeries OnGetMarkText causing compiler error

Post by Yeray » Fri Dec 17, 2010 3:22 pm

Hi Mary,

Try changing this part of the event signature:

Code: Select all

AnsiString &MarkText
for this:

Code: Select all

UnicodeString &MarkText
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply