CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2009
    Posts
    4

    Question createdocumentfromurl not supported in scripting?

    Hi,
    I'm using a light-weighted script to parse some html, the best way doing it will be create an instance of htmldocument by ms, use the createdocumentfromurl methode and hold a pointer to the returned object. But under vbscript and jscript a runtime error saying this method is not support pops in every machine I tried. I can use the htmldocument as a parser by writing to it the responsetext from httprequest or xmlhttp alright, but then I lose all the referer and other nice properties. The htmldocument is apparently a com object, so it's functionality should be available to whatever language capable of exposing it. Is it some security setting unspoken of?
    Gurus pls lend a hand.
    thanks.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: createdocumentfromurl not supported in scripting?

    Your problem is that the createDocumentFromUrl() method is from the IHTMLDocument4 library which was released with Internet Explorer 5.5 support. That method was not available after that. So, my guess is that unless you are running IE6 or older, you won't be able to use that method.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Oct 2009
    Posts
    4

    Re: createdocumentfromurl not supported in scripting?

    Thanks, but in MSDN documenting ihtmldocument4 says ie5.5 is the minimum requirement, not the only, and using oleexploerer I can see this interface with this specific method from mshtml.dll in a machine running ie7, and I can definitely use it in vba. So I cannot agree it is a version issue.

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: createdocumentfromurl not supported in scripting?

    But, it does not appear as a method of IHTMLDocument5 or version 6 which replaced version 4.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Oct 2009
    Posts
    4

    Exclamation Re: createdocumentfromurl not supported in scripting?

    Later versions are increments, not replacements. If yes, then this method will be unavailable with iex with x >5.5 which is clearly not true.

  6. #6
    Join Date
    May 2002
    Posts
    10,943

    Re: createdocumentfromurl not supported in scripting?

    Okay, I'll reword this one last time...IHTMLDocument6 extends IHTMLDocument5. When you see IHTMLDocument5 referenced, this is why IE8 can run in "compatibility" mode. However, IHTMLDocument4 is not extended by IHTMLDocument5.

    The jump from IE6 to IE7 was a huge leap. Code had to be deprecated and chopped off all in one move. This is an example of that case. If you honestly do not believe be...look at the methods found in your mshtml.dll library.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  7. #7
    Join Date
    Oct 2009
    Posts
    4

    Re: createdocumentfromurl not supported in scripting?

    I don't have vc installed but oleviewer on html document shows that mshtml.dll supports all the ihtmldocument interfaces and in vba which uses mshmtl.tlb, the same version as mshtml.dll (7.00.5730.13 (longhorn(wmbla).070711-1130)), can use methods of ihtmldocument2, so it is not reasonable to think ihtmldocument2 support is discontinued. A type library is just an export of the details of the dll, I suppose.
    May be it is something to do with "safe for scripting"?

Tags for this Thread

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

Featured