Sure, it can inherit from TWinControl but that doesn't change the crash.
Na, but it can introduce some problems down the road.
TWinControl normally needs a form as parent.
Without it, it can cause problems (at least that is my experience with Delphi).
If you don't do anything with parent, width, top, left etc (i.e. doesn't need a form component) you can better inherit from TComponent (which still has an Owner but not a Parent !!).
(Parent and Owner are different, Parent is for screen, Owner is for Create/Free)
Also do correct create and free in your buttonpress because now you don't release anything after the first press of the button.
procedure TForm1.Button1Click(Sender: TObject);
begin
Seven := TSevenUnpack.Create(nil); // <-- this can be nil if not created by the TForm itself (and because you free it yourself)
try
Seven.OnNextFile := @Next;
Seven.OnNextFileClose := @NextClose;
Seven.OnFileProgress := @Progress;
Seven.OnPasswordNeeded := @Pass;
F := TFileStream.Create('test2.7z', fmOpenRead);
Seven.Open(F);
Seven.Extract;
finally
Seven.Free;
end;
end;
It doesn;t fix the crash but the flow is better like this.