FindClass and RegisterClass in VCL Host and FMX plugin

Hi,

I used the the sample (VCLHost and fmxPlugin) to check and confirm the case:
delphi version from 10.3-10.4.1 , hydra latest versions(guess any version also can produce this error)

  1. if I registerclass for datamodule , it is correct.
  2. if I registerclass for Tform and use findclass to find it , it report with the Eclassnotfind error. if I dont ModuleManager.LoadModules(‘Plugin.dll’);, it can use findclass to find the tform.

Please advise how to solve it as I need use registerclass and findclass to create some form.

Hi,

can you create a simple testcase that reproduces this issue, pls?
it will allow to better understand your issue.

In VCL Host , Add one new Tform and one new Tdatamodule

add two button Click for it

procedure TMainForm.ToolButton1Click(Sender: TObject);
begin
  FindClass('TForm1'); << report class not found
end;

procedure TMainForm.ToolButton3Click(Sender: TObject);
begin
  FindClass('TDataModule2'); << this is correct.
end;

In TForm unit

initialization
  registerClass(TForm1);
end.

In TDataModule Unit
initialization
registerClass(TDataModule2);
end.

if you cancel ModuleManager.LoadModules(‘Plugin.dll’) at on formcreate, both findclass no error.

If you need you download VClHostSample.zip (134.1 KB)

Hi,

you should switch back to VCL objects.
use this code:

procedure TMainForm.ToolButton1Click(Sender: TObject);
begin
  ActivateClassGroup(TControl);
  FindClass('TForm1');
end;