Results 1 to 2 of 2

Thread: system.invalidcastexception

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2017
    Posts
    147

    system.invalidcastexception

    Code:
            RichTextBox1.Text = GeckoWebBrowser1.Document.DocumentElement.TextContent.ToString  <<<-------Error occurs here
    Anyone able to point me in the right direction how to resolve this. im just trying to view the inner htlm from a webpage navigated on the geckobrowser
    Attached Images Attached Images  

  2. #2
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,578

    Re: system.invalidcastexception

    At some point along that chain of objects, the object in question is not the thing that the library you're using thinks it is. This could be GeckoWebBrowser1, its Document property, or its DocumentElement property, or that's TextContent property. One of those things didn't respond to a COM call the way that code expected, so it threw this exception. You probably found a bug in that library. Or: you might be doing something earlier or later than it thinks. You'll have to ask whoever wrote that library, it's not widely used.
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width