In BDS XE6 I am trying yo put text using Canvas->FillText. I have some issues with const declaration and am not able to overcome the problem.
TRect *Rect = new TRect(0, 0, 100, 30);
Canvas->FillText(*Rect, "Hello", false, 100, TFillTextFlags() << TFillTextFlag::RightToLeft, TTextAlign::Center, TTextAlign::Center);
I get the compiler error:
[bcc32 Error] MyForm.cpp(109): E2522 Non-const function _fastcall TCanvas::FillText(const TRectF &,const UnicodeString,const bool, const float,const TFillTextFlags,const TTextAlign,const TTextAlign) called for const object
Full parser context
LavEsiti.cpp(107): parsing: void _fastcall TMyForm::MyGridDrawColumnCell(TObject *,const TCanvas *,const TColumn *,const TRectF &,const int,const TValue &,const TGridDrawStates)
I'd like to get some info on my mistake. Thank's in advance.
Problem solved by calling function with const_cast option: