In delphi 2009 I have a reference to a IInterface which I want to cast to the underlying TObject
IInterface
TObject
Using TObject(IInterface) obv
TObject(IInterface)
var N, F: NativeInt; // NativeInt is Integer(in delphi 32bit ) S: TObject; begin N := NativeInt(Args[0].AsInterface) - 12; {subtract 12 byte to get object address(in x86 ,1 interface on class) } S := TObject(N); writeln(S.ToString); end;