2
A
回答
9
只需使用@MyProcedure
即可。
要注意的是它必須有正確的調用約定(可能stdcall
)。
您通常不能使用成員函數,因爲它有一個隱藏的SELF
參數。
class
一個方法static
作用就像通常的程序/功能雖然。
0
創建這種類型的,如果程序(或功能)是方法
type
TMyProc = Procedure(x:Integer;y:Integer) of Object;
或該
type
TMyProc = Procedure(x:Integer;y:Integer);
如果過程是孤立的。
用法:
//Some class method
Procedure TfrmMain.Add(x:Integer;y:Integer);
begin
...
end;
//Another class method that uses procedure as parameter
procedure Name(proc : TMyProc);
begin
...
end;
//Call with:
Name(Add);
+1,也包括鏈接到文檔 – 2010-09-06 18:45:55