Specified cast is not valid Error

Specified cast is not valid Error in Webbrowser control

Page 1 of 1

1 Replies - 6948 Views - Last Post: 27 March 2008 - 07:51 AM Rate Topic: -----

#1 nealgabriel45  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 4
  • View blog
  • Posts: 46
  • Joined: 22-October 07

Specified cast is not valid Error

Posted 27 March 2008 - 12:33 AM

During the Execution of the below mentioned statement, Dot Net is throwing an error like

Specified cast is not valid.

WebBrowser.document.GetElementById("checkDate").InnerText


I have created a Thread to call the function which has the mentioned code.. Is there any Problem with the code or in using the Thread?
Thanks in advance for the help !
Is This A Good Question/Topic? 0
  • +

Replies To: Specified cast is not valid Error

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Specified cast is not valid Error

Posted 27 March 2008 - 07:51 AM

Well for starters you cannot access a GUI control from outside the thread which created it. Meaning you cannot access the controls from a separate thread. The only way you can access these controls from a different thread is to marshal the cal onto the thread which created them using a delegate.

I wrote a tutorial on this subject. Granted it's in C# but the logic is the same.
Was This Post Helpful? 1

Page 1 of 1