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. COM
  4. How to put HTML?

How to put HTML?

Scheduled Pinned Locked Moved COM
htmltutorialquestion
5 Posts 4 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I want to put HTML code to MSHTML. The code contains "FRAMESET" tag. I tried,,, IHTMLDocument3* doc3; ////get pointer doc3->get_documentElement(&pElement); pElement->put_outerHTML(L"") But I couldn't put HTML code. I tried next,, doc2->get_body(&pElement); pElement->put_innerHTML(L"") But I couldn't put HTML code. How to put HTML code?? Please tell me. I thought hardly.

    C S S 3 Replies Last reply
    0
    • L Lost User

      I want to put HTML code to MSHTML. The code contains "FRAMESET" tag. I tried,,, IHTMLDocument3* doc3; ////get pointer doc3->get_documentElement(&pElement); pElement->put_outerHTML(L"") But I couldn't put HTML code. I tried next,, doc2->get_body(&pElement); pElement->put_innerHTML(L"") But I couldn't put HTML code. How to put HTML code?? Please tell me. I thought hardly.

      C Offline
      C Offline
      CodeProjectSQ
      wrote on last edited by
      #2

      Try this. It works for me. From Steve. MSHTML::IHTMLElementPtr spEle; MSHTML::IHTMLDocument2Ptr spDoc2; CString sHtml; sHtml = "some HTML text here"; // get spDoc2 from CHtmlView spDoc2 = m_pBrowserApp->get_Document( (IDispatch**)&spDoc2 ); if ( spDoc2 == NULL ) return; spEle = spDoc2->Getbody(); if ( spEle == NULL ) return; spEle->PutinnerHTML( (LPCTSTR)sHtml );

      1 Reply Last reply
      0
      • L Lost User

        I want to put HTML code to MSHTML. The code contains "FRAMESET" tag. I tried,,, IHTMLDocument3* doc3; ////get pointer doc3->get_documentElement(&pElement); pElement->put_outerHTML(L"") But I couldn't put HTML code. I tried next,, doc2->get_body(&pElement); pElement->put_innerHTML(L"") But I couldn't put HTML code. How to put HTML code?? Please tell me. I thought hardly.

        S Offline
        S Offline
        Stephane Rodriguez
        wrote on last edited by
        #3

        Unlikely to work, just because in HTML a tag is not inside a tag. I would suggest to do instead : doc3->Write("..."); (which is the equivalent of Javascript's document.write("...") ),


        And I swallow a small raisin.

        1 Reply Last reply
        0
        • L Lost User

          I want to put HTML code to MSHTML. The code contains "FRAMESET" tag. I tried,,, IHTMLDocument3* doc3; ////get pointer doc3->get_documentElement(&pElement); pElement->put_outerHTML(L"") But I couldn't put HTML code. I tried next,, doc2->get_body(&pElement); pElement->put_innerHTML(L"") But I couldn't put HTML code. How to put HTML code?? Please tell me. I thought hardly.

          S Offline
          S Offline
          S A
          wrote on last edited by
          #4

          I tried,, BSTR bstr = SysAllocString(L"~~~"); SafeArrayCreateVector(VT_VARIANT, 0, 1); SafeArrayAccessData(sfArray,(LPVOID*) & param); param->vt = VT_BSTR; param->bstrVal = bstr; SafeArrayUnaccessData(sfArray); document->write(sfArray); But 'FRAME page' is blank page. Of course,The Page exists. I think document reset. Please tell me another method. Is it impossible ?

          S 1 Reply Last reply
          0
          • S S A

            I tried,, BSTR bstr = SysAllocString(L"~~~"); SafeArrayCreateVector(VT_VARIANT, 0, 1); SafeArrayAccessData(sfArray,(LPVOID*) & param); param->vt = VT_BSTR; param->bstrVal = bstr; SafeArrayUnaccessData(sfArray); document->write(sfArray); But 'FRAME page' is blank page. Of course,The Page exists. I think document reset. Please tell me another method. Is it impossible ?

            S Offline
            S Offline
            Stephane Rodriguez
            wrote on last edited by
            #5

            That works fine. In fact, when you do the equivalent of document.write() when the document is finished loading, IE simply creates a new one and put your HTML code in it. So, you should see the frames for your frameset. Please remember that a frameset by itself is a very special HTML tag that has no meaning inside an HTML .... If your aim is only to have one or more frames, I would recommend to use the tag instead, and use putinnerhtml,


            And I swallow a small raisin.

            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