Domanda

I'm developing an IE BHO, While accessing frames in a html document i'm getting this error

Here is the code.

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
   }
}

what is the issue here ?

È stato utile?

Soluzione

OK people i got it solved by setting [STAThread] at function calling

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top