R
RoboCop
Unregistered / Unconfirmed
GUEST, unregistred user!
I created a TImage object dynamiclly,and I wanted to response to the mouse click on it,so I wrote a handler function just like this:
void __fastcall MyOnClick(TObject *Sender)
Then I should assign it (the function pointer MyOnClick) to OnClick event of my TImage object,so I wrote the following code:
pImg->OnClick=(TNotifyEvent)MyOnClick;
But I got the following compiler error:
Cannot cast from 'void (_fastcall *)(System::TObject *)' to 'void (_fastcall * (_closure )(System::TObject *))(System::TObject *)'
I was completely confused,and would you topguns like to help me?
Thank you very much!
void __fastcall MyOnClick(TObject *Sender)
Then I should assign it (the function pointer MyOnClick) to OnClick event of my TImage object,so I wrote the following code:
pImg->OnClick=(TNotifyEvent)MyOnClick;
But I got the following compiler error:
Cannot cast from 'void (_fastcall *)(System::TObject *)' to 'void (_fastcall * (_closure )(System::TObject *))(System::TObject *)'
I was completely confused,and would you topguns like to help me?
Thank you very much!