🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #1620

TCppWebBrowser and Framed HTML Pages

#1620
From: Saulo I. Regis
Date: Wed, 03 Nov 2004 21:57
79 lines
3567 bytes
Hi,

I'm new to TCppWebBrowser and I'm having a hard time to figure out how to
get the complete HTML code of a framed homepage.

There is a homepage with those 3 traditional frames: a heading frame, a left
menu frame and a main frame that shows the real content of the web site.

I Navigate to the root URL of that homepage and after that I choose some
menu options that refreshes the contents of the main frame. When I reach the
desired content I'm trying to capture the HTML code of it.

To do this I'm using the following code (partial)

bool bDoc_Ok;
TComInterface<IHTMLDocument2> Doc;
bDoc_Ok = Browser1->Document;
if ( bDoc_Ok )
   Browser1->Document->QueryInterface(IID_HTMLDocument2, (LPVOID*)&Doc);
if ( Doc )
    {
          TComInterface<IPersistStreamInit> Psi;
          Doc->QueryInterface(IID_IPersistStreamInit, (LPVOID*)&Psi);
          if ( Psi )
              {
                 OleCheck(Psi->Save(*Adapter, FALSE));

                 cHtml = StrStrm->DataString;
                 .
                 .  do something with cHtml
                 .

               }

    }

when I execute this code with the TCppWebBrowser component fully loaded with
the desired content I'm receiving just the "root" html code of the homepage
that defines the FRAMESET structure of the page! Something like that
(partial)


<frameset rows="*" cols="154,*" frameborder="NO" border="0"
framespacing="0">

  <frame name="leftFrame" scrolling="NO" noresize
src="principal/index/menu.htm">

  <frameset rows="79,*" frameborder="NO" border="0" framespacing="0"
cols="*">

    <frame name="topFrame" noresize scrolling="NO"
src="principal/index/top.htm">

    <frame name="main" src="principal/main.htm">

  </frameset>

</frameset>

The main problem is that the actual URL that is being shown in the "main"
frame is not more "principal/main.htm". This URL is the "root" URL that is
first opened in that frame when the root URL of the web site is accessed.

My questions are:

#1. Why TCppWebBrowser() is not retrieving the updated URL of the "main"
frame after I had Navigated thru that web site?

#2. As TCppWebBrowser() already downloaded all the html code of all frames
how can I access them without having to reload it (even if I had the updated
"main" frame URL)?

#3. The OnDocumentComplete event is fired after each frame is loaded (and
once more to acknowledge that the whole "page" is ready!). How can I
"capture" the html code of the received frame inside the OnDocumentComplete
event handler using the LPDISPATCH pDisp parameter?

Saulo
Technical Details
Message-ID: <418954e8@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,2f5b16c00db0b7f3,start
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Saulo I. Regis" <saulo@password.info>
From: "Saulo I. Regis" <saulo@password.info>
Newsgroups: borland.public.cppbuilder.internet.web
Subject: TCppWebBrowser and Framed HTML Pages
Date: Wed, 3 Nov 2004 19:57:58 -0200
Lines: 81
Organization: Password Informatica Ltda
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 200.215.24.7
Message-ID: <418954e8@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1099519208 200.215.24.7 (3 Nov 2004 14:00:08 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail