<p>Am 12.12.2012 01:15 schrieb "luiz americo pereira camara" <<a href="mailto:luizmed@oi.com.br">luizmed@oi.com.br</a>>:<br>
><br>
> Some time ago, i was getting an error while trying to use RTTI<br>
> functions in a class descending directly of TObject<br>
><br>
> Later i discovered that i needed to descend from TPersistent due to<br>
> $M+ directive (<a href="http://www.freepascal.org/docs-html/prog/progsu44.html">http://www.freepascal.org/docs-html/prog/progsu44.html</a>),<br>
> so i did.<br>
><br>
> Now, i decided to go back and descend directly from TObject. To allow<br>
> RTTI usage i would put M+ around my own class<br>
><br>
> I tested again and using RTTI functions (SetOrdProp, GetPropInfo)<br>
> worked even without declaring {$M+}</p>
<p>Can you check whether your unit was really recompiled? Remove the .ppu and .o files for the unit to be on the save side. Also it could be that the switch was declared somewhere before your class and not disabled again with {$M-}</p>

<p>> So, is it really necessary to put $M+ to use RTTI?</p>
<p>Yes.</p>
<p>Regards,<br>
Sven</p>