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)
if I registerclass for datamodule , it is correct.
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.
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.