这是什么用法?
TStateMessage = procedure(Const Msg: String) of object;

解决方案 »

  1.   

    相当于对成员函数的引用,成员函数在implementation实现
      

  2.   

    这是一种函数指针类型,该指针可以指向
    所有函数外形(既参数表)与其类似的函数比如你定义了这样两个函数:
    procedure MyProc(Const MyMsg: String);
    begin
         ....
    end;procedure TheProc(Const TheMsg:String);
    beginend;有定义了
    TStateMessage = procedure(Const Msg: String) of object;
    var  sm :TStateMessage;
    ....
    那么,在程序中你就可以:
    sm := MyProc;

    sm := TheProc;
    然后,你就可以在程序中调用sm,
    sm('Hello');与MyProc('Hello')功能一样。sm('Hello');与TheProc('Hello')功能一样。