zoukankan      html  css  js  c++  java
  • Inno Setup入门(二十七)——使用dll(1)

    这里讲讲如何调用dll中的函数。先来一个简单的例子:
    [code]
    var
    myPage:TWizardPage;
    Button :TNewButton;
    Cnt:Integer;
    function GetCurrentProcessId(): Integer;
    external 'GetCurrentProcessId@C:\Windows\System32\kernel32.dll';
     
    procedure ButtonOnClick(Sender: TObject);
    begin
      MsgBox(IntToStr(GetCurrentProcessId()), mbInformation, mb_Ok); 
     
    end;
     
    procedure InitializeWizard();
    begin
    myPage:=CreateCustomPage(wpWelcome, '标题:自定义页面', '描述:这是我的自定义页面');
    Button := TNewButton.Create(mypage);
    Button.Width := ScaleX(75);
    Button.Height := ScaleY(23);
    Button.Caption := 'TNewButton';
    Button.OnClick := @ButtonOnClick;
    Button.Parent := mypage.Surface;
    end;

    运行效果如下:
    Inno Setup入门(二十六)——Inno Setup类参考(13) - Castor - 趁年轻,多折腾
    语句:
    function GetCurrentProcessId(): Integer;
    external 'GetCurrentProcessId@C:\Windows\System32\kernel32.dll';

    申明了引用dll的文件、函数和定义的函数。下次再说说调用的一些细节。

    转自:http://www.360doc.com/content/13/0327/14/4221543_274237315.shtml

  • 相关阅读:
    RedMine 1.3.3 安装攻略
    .net 4.0 framework 安装时发生严重错误
    MYSQL安装配置
    接口隔离ISP
    依赖倒置DIP
    VS2010添加WP模板
    VS2012尝鲜
    OCP开放闭合
    单一职责
    里氏替换
  • 原文地址:https://www.cnblogs.com/xiurui12345/p/3096606.html
Copyright © 2011-2022 走看看