我正在开发一个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
}
}
这里有什么问题?
答案 0 :(得分:2)
好的人我通过在函数调用
设置[STAThread]
来解决问题