resource not found after subclassing firemonkey form

  

Please help. I’m working on a longstanding Delphi project with several firemonkey forms that I wanted to make resizable. I put the resizing-relevant code in a new form that descended from TForm, and changed my existing forms to descend from the new form. That seemed to work, but now it fails during compilation with errors like “resource TLessonStudent not found”
Alarmingly, putting the code back the way it was before doesn’t remove the error. What is happening? Is there some way to create a resource file the compiler will like? Thanks! Art

I’ve tried adding and removing compiler directives such as {$R *.DFM} in various places. I also tried to put the code back the way it was before, with my forms once again descending directly from TForm. Still the same error.

Here is how the new top level form is declared:

type
TFluentTutorForm = class(TForm)
protected

resizableLayout: TScaledLayout;
procedure FormCreate(Sender: TObject);
private

function getScreenSize(var retWidth: integer; var retHeight: integer): boolean;
public
end; //TFluentTutorForm

var
fluentTutorForm: TFluentTutorForm;

implementation

{$R *.fmx}

Here is one of my old forms, modified to descend from the one above

type
TLessonStudent = class(TFluentTutorForm)

procedure FormCreate(Sender: TObject);
private
unitTester: IftUnitTester;
public
end; //TStudentForm

var
studentForm: TLessonStudent;

implementation

{the formCreate method shown above calls “inherited formCreate” on it’s
new parent, shown at top}

And here is the part of the project code that creates the form:

{$R *.res}

begin
Application.Initialize;
Application.FormFactor.Orientations := [TFormOrientation.Portrait];// InvertedPortrait];
Application.CreateForm(TlessonStudent, studentForm); //<here!!
Application.CreateForm(TClientModule1, ClientModule1);
Application.CreateForm(TDataModule1, DataModule1);
Application.CreateForm(TmemTableForm, memTableForm);
Application.Run;
end.

Comments are closed.