I'm creating a very basic TCustomControl with just a Constructor and its
Destructor.

TMyCustomControl = class(TCustomControl)
public
  constructor Create(TheOwner: TComponent);override;
  destructor Destroy; override; 
end;

In a main form's TForm.Create I'm creating an instance of my
TCustomControl, which is declared as a form variable, like
FMyCustomControl, for example:

constructor TMyForm.FormCreate(Sender: TObject);
begin
  FMyCustomControl := TMyCustomControl.Create(Self);
end;

So far TMyCustomControl's constructor is called, I can debug it, and
it's working ok.

Now, from another method of MyForm, I need to call a method of
TMyCustomControl, but I get a SIGSEGV:

procedure TMyForm.TestCustomControl;
begin
  FMyCustomControl.DoSomething;
end;

Apparently the reference of FMyCustomControl is lost.

I'm missing something?. Should I set or inherit more methods of
TCustomControl to make it work?.

Regards,
-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to