zoukankan      html  css  js  c++  java
  • delphi dll 实例 与 dll窗体实例

    delphi dll 实例 与 dll窗体实例

    本动态链接库方法有

    Min,Max,SynAPP,ShowForm,showmyform

    dll工程文件

    Library Project1;
    uses
      dllUnit1 in 'dllUnit1.pas' {Form1};

    function Min(X, Y: Integer): Integer; export;
    begin
    if X < Y then Min := X else Min := Y;
    end;
    function Max(X, Y: Integer): Integer; export;
    begin
    if X > Y then Max := X else Max := Y;

    end;
    procedure showmyform();export;
    begin
           Form1 := TForm1.Create(nil);
           Form1.ShowModal;
    end;

    exports
    Min,Max,SynAPP,ShowForm,showmyform;

    begin

    end.

    窗体单元文件:

    unit dllUnit1;

    interface

    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;

    type
      TForm1 = class(TForm)
        Button1: TButton;
        Button2: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;

    var
      Form1: TForm1;

      procedure SynAPP(App:THandle);stdcall;
      procedure ShowForm;stdcall;
    implementation



    {$R *.dfm}

    procedure SynAPP(App:THandle );stdcall;
    begin
      Application.Handle := App;
    end;
    procedure ShowForm;stdcall;
    begin

        Form1 := TForm1.Create (Application);


             // Form2 := TForm2.Create(Application);
              Form1.ShowModal;

    end;


    procedure TForm1.Button1Click(Sender: TObject);
    begin
    close;
    end;

    end.

  • 相关阅读:
    Java垃圾收集算法
    Java回收方法区中回收的类
    Android 聊天软件客户端
    Android 面试
    基于Android的简单聊天工具-服务器端
    Java多线程
    业务序号重排序
    Dubbo异步转同步
    Dubbo加权轮询负载均衡算法应用之推荐产品
    Linux文件句柄数配置
  • 原文地址:https://www.cnblogs.com/fengju/p/6173821.html
Copyright © 2011-2022 走看看