Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how do i find all "src" attributes from frame object of html document?

how do i find all "src" attributes from frame object of html document?

Scheduled Pinned Locked Moved C / C++ / MFC
questionhtmlhelp
9 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yogish293
    wrote on last edited by
    #1

    i have MSHTML::IHTMLDocument2Ptr pointer loaded with html document.there i can see all style sheets,images,iframe object. iframe object again will contain "src" attributes with source location. i want all iframe or frame objects "src" attributes from html document.... please help me

    B _ 2 Replies Last reply
    0
    • Y yogish293

      i have MSHTML::IHTMLDocument2Ptr pointer loaded with html document.there i can see all style sheets,images,iframe object. iframe object again will contain "src" attributes with source location. i want all iframe or frame objects "src" attributes from html document.... please help me

      B Offline
      B Offline
      Bram van Kampen
      wrote on last edited by
      #2

      yogish293 wrote:

      have MSHTML::IHTMLDocument2Ptr pointer loaded with html document.there i can see all style sheets,images,iframe object. iframe object again will contain "src" attributes with source location. i want all iframe or frame objects "src" attributes from html document....
      please help me

      You make Absolutely No Sense in a CPP Forum(I know you are desperate.) In this forum, HTML is as common as ancient greek. :)

      Bram van Kampen

      A 1 Reply Last reply
      0
      • B Bram van Kampen

        yogish293 wrote:

        have MSHTML::IHTMLDocument2Ptr pointer loaded with html document.there i can see all style sheets,images,iframe object. iframe object again will contain "src" attributes with source location. i want all iframe or frame objects "src" attributes from html document....
        please help me

        You make Absolutely No Sense in a CPP Forum(I know you are desperate.) In this forum, HTML is as common as ancient greek. :)

        Bram van Kampen

        A Offline
        A Offline
        Albert Holguin
        wrote on last edited by
        #3

        I did my first website in pure HTML from a text editor... :-O ...and btw, MSHTML is an HTML library, not straight up HTML...

        D C 2 Replies Last reply
        0
        • A Albert Holguin

          I did my first website in pure HTML from a text editor... :-O ...and btw, MSHTML is an HTML library, not straight up HTML...

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Albert Holguin wrote:

          I did my first website in pure HTML from a text editor... :O

          There are other ways?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

          1 Reply Last reply
          0
          • A Albert Holguin

            I did my first website in pure HTML from a text editor... :-O ...and btw, MSHTML is an HTML library, not straight up HTML...

            C Offline
            C Offline
            Code o mat
            wrote on last edited by
            #5

            Shh, such talk leads to Vi vs. Emacs flamewars... :)

            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > //TODO: Implement signature here<

            1 Reply Last reply
            0
            • Y yogish293

              i have MSHTML::IHTMLDocument2Ptr pointer loaded with html document.there i can see all style sheets,images,iframe object. iframe object again will contain "src" attributes with source location. i want all iframe or frame objects "src" attributes from html document.... please help me

              _ Offline
              _ Offline
              _Superman_
              wrote on last edited by
              #6

              IHTMLDocument2::get_frame will give you an IHTMLFramesCollection2 interface. Use IHTMLFramesCollection2::item to iterate through the collection. Each iteration will give you an IHTMLElement interface corresponding to each frame. Then use IHTMLElement::getAttribute to get the value of the SRC attribute.

              «_Superman_»  _I love work. It gives me something to do between weekends.

              _Microsoft MVP (Visual C++)

              Polymorphism in C

              Y 1 Reply Last reply
              0
              • _ _Superman_

                IHTMLDocument2::get_frame will give you an IHTMLFramesCollection2 interface. Use IHTMLFramesCollection2::item to iterate through the collection. Each iteration will give you an IHTMLElement interface corresponding to each frame. Then use IHTMLElement::getAttribute to get the value of the SRC attribute.

                «_Superman_»  _I love work. It gives me something to do between weekends.

                _Microsoft MVP (Visual C++)

                Polymorphism in C

                Y Offline
                Y Offline
                yogish293
                wrote on last edited by
                #7

                _variant_t MSHTML::IHTMLFramesCollection2::item(VARIANT var); this is declaration of item function... there is no interface to get IHTMLElement...

                _ 1 Reply Last reply
                0
                • Y yogish293

                  _variant_t MSHTML::IHTMLFramesCollection2::item(VARIANT var); this is declaration of item function... there is no interface to get IHTMLElement...

                  _ Offline
                  _ Offline
                  _Superman_
                  wrote on last edited by
                  #8

                  The VARIANT will contain the IDispatch pointer of the frame element. You can do a QueryInterface for an IHTMLElement on this IDispatch pointer.

                  «_Superman_»  _I love work. It gives me something to do between weekends.

                  _Microsoft MVP (Visual C++)

                  Polymorphism in C

                  Y 1 Reply Last reply
                  0
                  • _ _Superman_

                    The VARIANT will contain the IDispatch pointer of the frame element. You can do a QueryInterface for an IHTMLElement on this IDispatch pointer.

                    «_Superman_»  _I love work. It gives me something to do between weekends.

                    _Microsoft MVP (Visual C++)

                    Polymorphism in C

                    Y Offline
                    Y Offline
                    yogish293
                    wrote on last edited by
                    #9

                    for(long nfram = 0; nfram < pColFrames->length ; nfram ++) { _variant_t vIdx(i, VT_I4); _variant_t vDisp; vDisp = pColFrames->item(&vIdx); if(vDisp.vt == VT_DISPATCH) { vDisp.pdispVal->QueryInterface(IID_IHTMLElement,(void**)&pElem); ...................//rest of operation } } but always if(vDisp.vt == VT_DISPATCH) will fail...means vDisp.vt become empty.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups