title: How to cast a Interface to a Object in Delphi
body: <p>In delphi 2009 I have a reference to a <code>IInterface</code> which I want to cast to the underlying <code>TObject</code></p>
  
  <p>Using <code>TObject(IInterface)</code> obviously doesn't work in Delphi 2009 (it's supposed to work in Delphi 2010 though)</p>
  
  <p>My searches lead me to <a href="http://hallvards.blogspot.com/2004/07/hack-7-interface-to-object-in-delphi.html" rel="noreferrer">a function that should do the trick</a>, but it doesn't work for me, I get AV's when I try to call methods on the returned object.</p>
  
  <p><sup>I can't really modify the Classes and I know that this breaks OOP</sup></p>