一、在DLL中封装窗口
打开Delphi新建一个DLL工程,保存为usedll,生成代码
library usedll; { Important note about DLL memory management: ShareMem must be the uses {$R *.res} begin |
新建一个窗体,添加一个Label和Button,设置如下:
object Form1: TForm1 Left = 192 Top = 133 Width = 334 Height = 221 Caption = 'DLL'#20013#20351#29992#31383#20307 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False PixelsPerInch = 96 TextHeight = 13 object Label1: TLabel Left = 104 Top = 80 Width = 80 Height = 13 Caption = 'DLL'#20013#20351#29992#31383#20307 end object Button1: TButton Left = 120 Top = 152 Width = 75 Height = 25 Caption = #30830#23450 TabOrder = 0 OnClick = Button1Click end end |