I'm doing some work with RTTI in Delphi XE3 and so far, this has resulted in a call to a procedure as follows:
procedure MyProc( ARecordInstance : pointer; ARecordType : PTypeInfo );
and I call this routine as follows:
MyProc( @MyRec TypeInfo( TMyRec ));
This all works fine.
It occurs to me that I might be able to simplify my procedure to:
procedure MyProc( var ARecord ); or procedure MyProc( ARecord : pointer );
..if I can get the type info from ARecord within my procedure. Working with an 'instance' such as 'ARecord' though, TypeInfo gives 'expects a type identifier' error, which is fair. Is there any way that I can pass a single pointer reference to my record and then extract the type from it?
Thanks