type
    TGetdatas=function (RoServerAddress:string;Iport:Integer;var vDatas:OleVariant):Boolean; stdcall;
    TSetdatas=function (RoServerAddress:string;Iport:Integer;var vDatas:OleVariant):Boolean; stdcall;

解决方案 »

  1.   

    申明2个函数类型。
    stdcall; 
    表示函数调用的方式
      

  2.   


    类函数是class procedure(function),又是另外一回事了.这个相当于静态函数.不依赖于类的实例的
      

  3.   

    其实跟定义其他类型差不多,看上去有点抽象,你看看它怎么使用的就知道了.比如比较常用的回调函数是这样做的(网上copy过来了)1、定义一个回调函数类型                        
    例:
    type
      THDFunction= function(I:integer;s:string):integer; stdcall;
     
    2、然后根据此原形定义一个相应的函数或过程,对于这个函数或过程来说名字没有什么要求,对函数其参数的类型和返回值的类型必须和定义的回调函数类型完全一致。
    例:
    函数原形定义:
    Function HdFunExample(k:integer,sExam:string):integer; stdcall;3、在程序中实现此回调函数或着过程;
    Function HdFunExample(k:integer,sExam:string):integer; stdcall;
    Begin
      //实现
    End;     
    4、调用过程;
    回调函数一般作为系统的某个函数的入口地址;
    根据调用函数的原形:
    假设有如下调用函数:
    function DyHdFunExample(HdFun:THDFunction;I:integer):boolean;
    注:
       在调用函数中通过对函数指针的处理可以直接调用回调函数(即调用函数中的那个是回调函数类型的参数,直接操作它),使回调函数履行一定的操作。即在调用函数中实现回调函数的功能。
     
    调用:var
    I:integer;
    begin
    I:=DyHdFunExample(@HdFunExample,i);
    //…….
    End;
    资料引用:http://www.knowsky.com/335689.html