The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,867 other followers

Getting the class from an TRttiProperty by using MetaclassType

Posted by jpluimers on 2019/01/09

Basically I learned that I should not only look for ClassType, but also for MetaclassType: [WayBack] Not a major problem, but given that xProp is a TRttiProperty instance is there a better way to get the ClassType of a property that is tkClass? – Chad Hower – Google+:

Chris Rolliston

The System.Rtti way is this –

x := xProp.PropertyType.AsInstance.MetaclassType;

Been in since TRttiContext was first added, IIRC.

It indeed has been documented since Delphi 2010: [] Rtti.TRttiClassRefType.MetaclassType – RAD Studio VCL Reference


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: