TMsgCallback = procedure(msg:pchar);stdcall;
FCallBack:TMsgCallback;procedure RespondMsg(Msg:string;lpCallBack:TMsgCallback = NIL);
begin
  FCallBack := TMsgCallback(lpCallBack);
  if FCallBack <> nil then   //编译时为什么会错 Not enough actual parameters
    {do something}
  else
    {do something}
end;

解决方案 »

  1.   

    我也相知道为什么?
    但是我知道改成这样可以通过编译:
    if Assigned(FCallBack) then ...
      

  2.   

    刚才看了一下帮助,发现也可以改成这样:
    if @FCallBack <> nil then...FCallBack是一个过程引用。判断他是否为空须在前面加一个@Use Assigned to determine whether the pointer or procedure referenced by P is nil. P must be a variable reference of a pointer or procedural type. Assigned(P) corresponds to the test P<> nil for a pointer variable, and @P <> nil for a procedural variable.
      

  3.   

    可以用if Integer(FCallBack) <> nil then   来判断
      

  4.   

    if Integer(FCallBack) = 0 then   
    或者
    if not Assign(FCallBack) then