Problem accessing Free method of Class after DefineClassByRTTI

Hello,

I have problem if I call:

IDEScripter1.DefineClassByRTTI(TForm1, TRedefineOption.roOverwrite,false,[mvPublished]);

then I do not see Free method of any other classes. It's because TObject is ancestor and Free is mvPublic. How to solve this situation? I do not want to see public properties of some forms.

Thank you

Example code:

type
 TMyClass=class
 published
  procedure MyCode;
 end;

procedure TForm1.Button3Click(Sender: TObject);
begin
 IDEScripter1.DefineClassByRTTI(TForm1,roOverwrite,false,'',[mvPublished]);
 IDEScripter1.DefineClassByRTTI(TMyClass);
 IDEDialog1.Show;
end;

If you need such specific registration, I recommend that you do some manual tweaking of the classes.
You can for example remove the properties you don't want, or manually add the properties you want.

Ok, what is the best solution to remove some Properties after DefineClass?

Use RemoveProperty:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.