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 1,470 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: [Archive.is] Rtti.TRttiClassRefType.MetaclassType – RAD Studio VCL Reference

–jeroen

Leave a Reply

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

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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

 
%d bloggers like this: