2

我正在开发 IE BHO,在访问 html 文档中的框架时出现此错误

这是代码。

foreach (SHDocVw.InternetExplorer objExplorer in objShellWins)
{
   if (objExplorer.Document is HTMLDocument)
   {
      objDocument = (mshtml.HTMLDocument)objExplorer.Document;
      mshtml.HTMLDocument doc = (mshtml.HTMLDocument)objExplorer.Document;
      mshtml.FramesCollection frames = (mshtml.FramesCollection)doc.frames;  //Exception at this line
   }
}

这里有什么问题?

4

1 回答 1

3

好的,我通过设置[STAThread]函数调用解决了它

于 2013-10-09T14:43:33.647 回答