The following two definitions are often seen in Delphi
Type
Tmouseproc = procedure (X,y:integer);
Tmouseevent = procedure (X,y:integer) of Object;
They look the same, but the actual meaning is different,
Tmouseproc is only a single function pointer type;
Tmouseevent is a function pointer to an object, which is the function/method of an Object/class
The difference is that the class method has a hidden parameter, self, which means that the two parameters are different, so they cannot be converted to each other
This is why Delphi can be assigned such button1.onclick:=button2.onclick;
But can not be so assigned to the value of Button1.onclick=buttonclick; (ButtonClick is the local function, Button2.onclick is the class method)!
http://blog.csdn.net/procedure1984/article/details/3897155
Two definitions of Delphi function pointers (object methods exist with a hidden argument self, so they cannot be assigned to each other)