I’m looking for a way of scanning all loaded classes for classes which contain a custom attribute, if possible, without using RegisterClass().
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
at first you have to create
TRttiContext, then get all loaded classes usinggetTypes. after that you can filter types byTypeKind = tkClass;next step is to enumerate attributes and check if it has your attribute;
attribute and test-class delcaration:
and then find it:
output is
Unit3.TTestso if you don’t need component streaming (just find classes with some attribute), there is no need to
RegisterClass