Hello, I'm trying to create and free my class. In the main lpr file I haver this code:
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
// Application.CreateForm(TForm1, Form1);
D:=TDownload.Create(nil);
D.DoRun;
Application.Run;
D.Free;
end.
It never reaches D.Free when I debug my program. I tried to place the line to different places however it caused other problems. How can use forms and classes together?
Modify:
Here's how I declare my class:
TDownload = class(TForm1)
private
LinkToFile : string;
TaskToKill : shortstring;
public
constructor Create(AOwner: TComponent); reintroduce;
constructor Create(AOwner: TComponent; L: string; T: shortstring); reintroduce;
destructor Destroy; override;
procedure SetLinkToFile(L: string);
function GetLinkToFile(): string;
...