I'm using BCB2010, so I'm not sure if this impacts Delphi users. In TElXTree, the "CanDrag" event has this signatore:-
TElXCanDragEvent = procedure(Sender: TObject; const Item: TElXTreeItem; var CanDrag: Boolean) of object;
The C++ function for this is...
void __fastcall TMainForm::xCanDrag(TObject */*Sender*/,
const TElXTreeItem *Item, bool &CanDrag)
{
CanDrag = (Item->Text == "Hello");
}
But, because property access functions like GetText are not const functions, I get the following compiler error:
[BCC32 Error] pdesign.cpp(877): E2522 Non-const function _fastcall TElXTreeItem::GetText() called for const object
Obviously I can use a cast to fix this, but it shouldn't be necessary.
Comments