Extending TSelectDirectoryDialog lazarus / 10-Designer ---------------------------------------------------------------------- Leledumbo · 2007-08-29 04:58 I'm trying to extend the TSelectDirectoryDialog so it contains TCheckBox inside the dialog. It compiles, but I got AccessViolation at runtime. Here's the code: Code: [Select] unit xxx; ... interface type   TMySelectDirectoryDialog = class(TSelectDirectoryDialog)     CheckRecurse: TCheckBox;     constructor Create(AOwner: TComponent); override;   end; ... implementation constructor TMySelectDirectoryDialog.Create(AOwner: TComponent); begin   Inherited Create(AOWner);   Title:='Select Folder to Add';   Options:=[ofPathMustExist,ofViewDetail];   with CheckRecurse do begin     Autosize:=true;     Checked:=false;     Left:=14;     Top:=10;     Caption:='Recurse Subdirectory';   end; end; ... end. Anyone can help? ---------------------------------------------------------------------- arnoldb · 2007-08-29 07:24 You'll have to add "CheckRecurse := TCheckbox.Create(AOwner)" in constructor TMySelectDirectoryDialog You are getting the access violation because the checkbox has not been created. HTH ---------------------------------------------------------------------- Marc · 2007-08-29 10:12 Create it with Self and not AOwner