unit Unit2;
interface
uses Classes,Dialogs;
type
TA=class(Tcomponent)
public
constructor create(AOwner:Tcomponent);override;
end;
type
TB=class(TA)
public
constructor create(AOwner:TComponent);override;
end;
implementation
{ TA }
constructor TA.create(AOwner: Tcomponent);
begin
inherited;[red]这里一个断点[/red]
showmessage('aaa');
end;
{ TB }
constructor TB.create(AOwner: TComponent);
begin
inherited;[red]这里一个断点[/red]
ShowMessage('bbb');
end;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
btn1: TButton;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
var
b:TB;
procedure TForm1.btn1Click(Sender: TObject);
begin
b:=TB.create(self);
end;
end.
constructor TComponent.Create(AOwner: TComponent);
begin
FComponentStyle := [csInheritable];[red]这里一个断点[/red]
if AOwner <> nil then AOwner.InsertComponent(Self);
end;
[red]为什么就不能跟踪到最后一个断点的位置[/red]