In Delphi 2007, I added a new string type to my project:
type String40 = string;
This property is used in a class:
type TPerson = class private FFirstName = String40; published FirstName: string40 read FFirstName write FFirstName; end;
During runtime, I want to get the name of the property FirstName by using RTTI. I expect it to be String40:
var MyPropInfo: TPropInfo; PropTypeName: string; MyPerson: TPerson; begin MyPerson := TPerson.Create; MyPropInfo := GetPropInfo(MyPerson, 'FirstName')^; PropTypeName := MyPropInfo.PropType^.Name;
However, in this example PropTypeName is ‘string’. What do I need to do get the correct property type name, ‘String40’?
This works in Delphi5
As for the rest of your code, to have RTTI available you should
Edit: what happens if you compile and run this piece of code?