Problem Source: http://www.cnblogs.com/del/archive/2008/07/30/1039045.html#1272783
In the compiler's view, overloaded functions are fundamentally different functions, and of course there are different function addresses; The address we get with the usual method is just the first overloaded address.
Code files:
UnitUnit1;InterfaceusesWindows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms, Dialogs;typeTForm1 =class(Tform)procedureFormcreate (Sender:tobject);End;varForm1:tform1;Implementation{$R *.DFM}{Example two overloaded functions first}functionMyfun (S:string):string;Overload;beginResult: = s;End;functionMyfun (I:integer):string;Overload;beginResult: = IntToStr (i);End;{Get the address of the overloaded function separately}procedureTform1.formcreate (Sender:tobject);type {Two method types need to be defined, with arguments corresponding to the overloaded function above}TF1 =function(s:string):string; TF2 =function(I:integer):string;varF1:TF1;{corresponds to overloading one}F2:TF2;{corresponds to overloaded two}S1,S2:string;beginF1: = Myfun;{Let F1 point to overload one}F2: = Myfun;{Let F2 point to overloaded two}{Test Function}S1: = F1 (' abc '); S2: = F2 (123); SHOWMESSAGEFMT ('%s ',%s ', [S1,S2]);{ABC, 123}{The first two values are the addresses of two overloaded functions; the third value is obtained from the function name, which is the same as the address of the first overload}SHOWMESSAGEFMT ('%p,%p,%p ', [@f1, @f2, @MyFun]);{Another method}SHOWMESSAGEFMT ('%p,%p,%p ', [Addr (F1), ADDR (F2), Addr (Myfun)]);{If it is a method in the class published, you can also get the address using methodaddress}End;End.
Http://www.cnblogs.com/del/archive/2008/07/30/1256889.html
Gets the address of the function (three methods, respectively @,addr,methodaddress)