title: How to use IUIAutomation::ElementFromIAccessible method in C#?
body: <p>I've tried to use <code>ElementFromIAccessible</code> method via:</p>
  
  <pre><code> System.Windows.Automation;
   ...
   [DllImport("UIAutomationClient.dll")]
      public static extern int ElementFromIAccessible(
          IAccessible accessible,
          int childId,
          [In, Out, MarshalAs(UnmanagedType.IUnknown)] ref AutomationElement element);
  </code></pre>
  
  <p>where <code>AutomationElement</code> is from <code>System.Windows.Automation</code>.</p>
  
  <p>And when I try to call it like:</p>
  
  <pre><code> Win32.ElementFromIAccessible(this.Accessible, 0, ref automaitonElement);
  </code></pre>
  
  <p>It fails with </p>
  
  <blockquote>
    <p>"System.Runtime.InteropServices.MarshalDirectiveException" "Unable to
    pack parameter #3"</p>
  </blockquote>
  
  <p>How Do I map it right way?</p>