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.

  • 相关阅读:
    【POJ】[1703]Find them, Catch them
    【杭电】[2717]Catch That Cow
    【杭电】[2717]Catch That Cow
    【杭电】[1716]排列2
    【杭电】[1716]排列2
    【杭电】[2084]数塔
    【杭电】[2084]数塔
    【杭电】[1003]Max Sum
    【杭电】[1003]Max Sum
    [leetcode]117. Populating Next Right Pointers in Each NodeII用next填充同层相邻节点
  • 原文地址:https://www.cnblogs.com/fengju/p/6173821.html
Copyright © 2011-2022 走看看