I have a Type:
TControlPointer = ^TControl;
And a private field in a class:
TMyClass = class(TObject)
private
FPointer : TControlPointer;
end;
When a I try to set the value for FPointer using RTTI:
procedure SetControlPointer(pControl : TControlPointer);
[...]
RTTIField.SetValue(Self,pControl);
Compiler says [dcc32 Error] myunit.pas (xxx): E2010 Incompatible types: 'TValue' and 'TControlPointer'
Any ideas?
Thank you
The error is simply telling you that
RTTIField.SetValue
expects to be passed aTValue
. So I guess you just need to put the pointer into aTValue
That's what you pass to
RTTIField.SetValue
.You can probably let the compiler infer the type and simply write