代码之家  ›  专栏  ›  技术社区  ›  Maltrap

Inno设置中的函数指针

  •  4
  • Maltrap  · 技术社区  · 17 年前

    Inno Setup中是否支持函数指针?我在文档中找不到任何东西。我知道Delphi/Pascal支持它们,由于Inno Setup脚本引擎基于它,我希望它能得到支持。

    1 回复  |  直到 8 年前
        1
  •  7
  •   Martin Prikryl    8 年前

    我刚刚做了一个小测试,函数指针确实有效。下列 [Code] 该部分编译良好,工作正常:

    type
      TStrProc =  procedure (const AStr: String);
    
    procedure Call(const AProc: TStrProc; const AStr: String);
    begin
      AProc(AStr);
    end;
    
    procedure ShowStr(const AStr: String);
    begin
      MsgBox(AStr, mbInformation, MB_OK);
    end;
    
    function InitializeSetup(): Boolean;
    begin
      Call(@ShowStr, 'Hello World!');
    end;
    

    BTW:Inno安装程序使用 the Pascal Script engine from RemObjects 。也许你可以在那里找到更多信息。

    推荐文章