access violation at address 504F0554 in module vcl200.bpl. reading address 00000000
is thrown. The exception is not thrown at run-time.
If I pass nil or the panel's owner as owner to TChart.Create everything is fine.
Here's an outline of the component:
Code: Select all
interface
type
TCollChartPanel = class(TPanel)
private
FChart : TChart;
...
public
constructor Create(Owner : TComponent); override;
...
end;
...
procedure Register;
implementation
...
constructor TCollChartPanel.Create(Owner : TComponent);
begin
inherited;
Self.Parent := Owner as TWinControl;
Self.BevelOuter := bvNone;
Self.BevelInner := bvNone;
Self.BorderStyle := bsNone;
FChart := TChart.Create(Self); // nil or Owner works fine
FChart.Parent := Self;
FChart.Align := alClient;
end;
...
procedure Register;
begin
RegisterComponents('Collinor', [TCollChartPanel]);
end;