title: JNA Pointer cast to struct
body: <p>I have a pointer in a struct. And I passed a struct pointer to this pointer.</p>
  
  <p>But I could not type cast back to this pointer to struct.</p>
  
  <pre><code>public class Test
  {
  
       //
       Pointer ptr = new Memory(4);
  }
  
  public class Temp extends Structure
  {
  
       //
  
  }
  
  Test tst = new Test();
  Temp tmp = new Temp();
  
  tst.ptr = tmp.getPointer();
  
  ...
  
  Temp newTmp = (Temp)tst.ptr.getPointer(); // This is not working.
  </code></pre>