🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to get the "real live" HTML source?

#380
From: Remy Lebeau (TeamB)
Date: Sat, 16 Dec 2006 01:25
51 lines
2566 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:4583480c$1@newsgroups.borland.com...

> Then you should use Internet Explorer's DOM interfaces to grab the current
> text of the desired TimeLeft field.

For example:

    #include <mshtml.h>
    #include <utilcls.h>

    void __fastcall TMyCppWebBrowser::OnDocumentComplete(TObject *Sender,
LPDISPATCH pDisp, TVariant *URL)
    {
        if( MyCppWebBrowser->Document )
        {
            TComInterface<IHTMLDocument2> Doc;
            MyCppWebBrowser->Document->QueryInterface(IID_IHTMLDocument2,
(LPVOID*)&Doc);
            if( Doc )
            {
                TComInterface<IHTMLElementCollection> All;
                Doc->get_all(&All);
                if( All )
                {
                    TVariant ItemName(L"TimeLeft", false);
                    TVariant ItemIndex = 0;
                    TComInterface<IDispatch> Disp;

                    All->item(ItemName, ItemIndex, &Disp);
                    if( Disp )
                    {
                        TComInterface<IHTMLElement> Element;
                        Disp->QueryInterface(IID_IHTMLElement,
(LPVOID*)&Element)
                        if( Element )
                        {
                            WideString text;
                            Element->get_innerText(&text);

                            // use text as needed ...
                        }
                    }
                }
            }
        }
    }


Gambit
Technical Details
Message-ID: <45834aa4$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4582e657@newsgroups.borland.com> <4582eb35$1@newsgroups.borland.com> <45831d53@newsgroups.borland.com> <4583480c$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,b54437b3b496861e
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <4582e657@newsgroups.borland.com> <4582eb35$1@newsgroups.borland.com> <45831d53@newsgroups.borland.com> <4583480c$1@newsgroups.borland.com>
Subject: Re: How to get the "real live" HTML source?
Date: Fri, 15 Dec 2006 17:25:03 -0800
Lines: 53
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.34.171
Message-ID: <45834aa4$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1166232228 75.83.34.171 (15 Dec 2006 17:23:48 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail