*.dcu文件是编译好了的单元文件。是提供共享而不提供源代码的好方法。
但你必须知道该文件中提供的接口。例如,该文件提供Function abc:string;
只要在你的单元文件中uses AnimationEffect; 就可以直接调用函数abc如果你不知道该文件提供的接口,则无法使用。Interface
uses windows, ....
编译时Link的是...\lib\windows.dcu,而不是...\Source\Rtl\win\windows.pas
但你必须知道该文件中提供的接口。例如,该文件提供Function abc:string;
只要在你的单元文件中uses AnimationEffect; 就可以直接调用函数abc如果你不知道该文件提供的接口,则无法使用。Interface
uses windows, ....
编译时Link的是...\lib\windows.dcu,而不是...\Source\Rtl\win\windows.pas
然后在程序中 输入AnimationEffect.一般都会跳出来那个窗口,你可以看到里面有什么方法,事件等
Forms,
Unit1 in 'Unit1.pas' {Form1};{$R *.RES}begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
---------------------------------------------------------
unit1.dfmobject Form1: TForm1
Left = 192
Top = 107
Width = 696
Height = 480
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
end
---------------------------------------------------------
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
uses
AnimationEffect;//引用该单元
{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
var
MyAniForm:TAnimationEffect;
begin
MyAniForm:=TAnimationEffect.Create(Self);
with MyAniForm do
begin
AnimateOnShow := True;
AnimateOnHide:= True;
Delay := 100;
FireworkBlasts := 10;
Frames := 6;
EffectType := etFireworks;
Steps := 50;
end;
end;end.为何???