E2034 Cannot convert void (_fastcall * (_closure ) (TCustomGridEh *, TGridEhCellMouseEvent



 void __fastcall TForm3::FormCreate(TObject *Sender)
{

 this->DBGridEh1->OnCellMouseClick = myDBGridEh1CellMouseClick;
}

void __fastcall TForm3::myDBGridEh1CellMouseClick(TCustomGridEh *Grid,  Gridseh::TGridCoord &Cell,
    TMouseButton Button, TShiftState Shift, int X, int Y, bool &Processed)

{
;
}



[bcc32 Error] Unit3.cpp(72): E2034 Cannot convert 'void (_fastcall * (_closure )(TCustomGridEh *,TGridCoord &,TMouseButton,TShiftState,int,int,bool &))(TCustomGridEh *,TGridCoord &,TMouseButton,TShiftState,int,int,bool &)' to 'TGridEhCellMouseEvent'
  Full parser context
    Unit3.cpp(70): parsing: void _fastcall TForm3::FormCreate(TObject *)


查看定义

C:\Users\Public\Documents\RAD Studio\12.0\hpp\GridsEh.hpp

 __property OnCellMouseClick;

 __property Gridseh::TGridEhCellMouseEvent OnCellMouseClick = {read=FOnCellMouseClick, write=FOnCellMouseClick};


typedef void __fastcall (__closure *TGridEhCellMouseEvent)(TCustomGridEh* Grid, const TGridCoord &Cell, System::Uitypes::TMouseButton Button, System::Classes::TShiftState Shift, int X, int Y, bool &Processed);


看出区别在与头文件里的原始定义有const 修饰符,但是新的定义里没有加上就可以了

void __fastcall TForm3::myDBGridEh1CellMouseClick(TCustomGridEh *Grid, const Gridseh::TGridCoord &Cell,
 TMouseButton Button, TShiftState Shift, int X, int Y, bool &Processed)

{
 ;
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值