title: "specified cast not valid" when using execScript
body: <p>I'm trying to execute a script on an iframe inside IE but i get "specified cast not valid" all the time: </p>
  
  <pre><code>IWebBrowser2 iWebBrowser2 = GetIframe(); //retrieve the iframe (saved in document complete event) 
  IHTMLDocument2 document = iWebBrowser2.Document as IHTMLDocument2; 
  document.parentWindow.execScript("alert('test');", "javascript"); 
  </code></pre>
  
  <p>The problem occurs when i'm trying to access the document.parentWindow (even asking if document.parentWindow != null).</p>
  
  <p>It's important so say that i'm doing it from a different thread that the document complete event thread.</p>
  
  <p>can you help me with this problem? </p>
  
  <p>Thanks,</p>
  
  <p>Omri</p>