简单的程序

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    btn1: TButton;
    procedure btn1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    m_lObjectID: LongInt;
    m_Object: TTest;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.btn1Click(Sender: TObject);
begin
  if (m_lObjectID <> 0) then
  begin
    TTest(m_lObjectID).ShowMyInfo;
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  m_Object := TTest.create;
  m_lObjectID := LongInt(m_Object);
end;

end.

本文出自 “冰是睡着的水” 博客,谢绝转载!

你可能感兴趣的:(windows,procedure,程序,的)