Gabor Boros wrote
Show quoted text 25 lines
Hi All,
I have a component like this:
TMyComponent=class(TPersistent)
private
FPicture:TPicture;
public
constructor Create;
published
property Picture:TPicture read FPicture write FPicture;
end;
constructor TMyComponent.Create;
begin
inherited;
FPicture:=TPicture.Create;
end;
When click on the Picture property in OI the "Load Image Dialog" showed
then click on Load button and got SIGSEGV. Where is the source of the
problem?
Gabor
AFAIK as I know, you have to derive minimal from TComponent. Just tested (and it works for me):
TMyComponent = class(TComponent)
private
FPicture: TPicture;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Picture: TPicture read FPicture write FPicture;
end;
constructor TMyComponent.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FPicture := TPicture.Create;
end;
destructor TMyComponent.Destroy;
begin
FPicture.Free;
inherited Destroy;
end;
I've added the simple TMyComponent package. MyComponents.zip <http://free-pascal-lazarus.989080.n3.nabble.com/file/n4049040/MyComponents.zip>
Kind regards
Michael