Good evening! I have a problem that happens when using attributes in delphi, I have the following constructor:
constructor Create(Value: Variant; Operacoes: TCompare;
Referencia: TReferenceCompare; Origem: String; Tipo: TVarType); overload;
and in the Value parameter gives the following error message: "Could not convert variant of type (Error) into type (OleStr)".
Note that when I change this parameter because a string works perfectly, I'm calling it as follows:
[TAtributo ('Edit4.Text', tcNotLess, rcObject, 'Text', varInteger)]
The message happens when I assign to a property of my class, I am having difficulty because the error happens only when I use it in the constructor of the custom attribute, when creating a method inside my form for example, right. I encountered another error when using RTTI within the methods of the attribute class, when I declare to RTTI uses after the attribute, it compiles, but does not work, to function was to just declare before the declaration of the class. So I'm suspicious of being a TCustomAttribute I have to use differently, but I'm not sure how to do this, could anyone help me? Thank you very much in advance. If someone can explain it too, or suggest a link where I can understand more about attributes, I'm grateful.