🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Help with TCppWebBrowser - Find and click a button

#387
From: Michael Harris
Date: Mon, 08 Jan 2007 19:05
65 lines
3041 bytes
get source is similar to below.

As Hans pointed out. the html being parser in your iter. function is not 
finding the actual html you are seeing on the page.
Hans also provided source to iter the frames in the various framesets.

--

Michael

AnsiString GetSource ( TCppWebBrowser *CppWebBrowser )
{
  AnsiString Source = "";

  IHTMLDocument2 *htm = NULL;     // #include <mshtml.h>

  if(CppWebBrowser->Document
     && 
SUCCEEDED(CppWebBrowser->Document->QueryInterface(IID_IHTMLDocument2, 
(LPVOID*)&htm))
     )
    {
    IPersistStreamInit *spPsi = NULL;    // ocidl.h

    if(SUCCEEDED(htm->QueryInterface(IID_IPersistStreamInit, 
(LPVOID*)&spPsi)) &&spPsi)
       {
        IStream *spStream = NULL;            // objidl.h
            OleCheck(CreateStreamOnHGlobal(NULL, true, &spStream));
            if(spStream)
            {
                __int64 nSize = 0;
                STATSTG ss;
                LARGE_INTEGER nMove;
                nMove.QuadPart = 0;
                OleCheck(spPsi->Save(spStream, true));
                OleCheck(spStream->Seek(nMove, STREAM_SEEK_SET, 
(ULARGE_INTEGER*)&nSize));
                OleCheck(spStream->Stat(&ss, STATFLAG_NONAME));
                nSize = ss.cbSize.QuadPart;

                Source.SetLength(nSize);
                OleCheck(spStream->Read((void *)Source.data(), nSize, 
(ULONG*)&nSize));
                OleCheck(spStream->Release());
            }

         spPsi->Release();
        }
    htm->Release();
    }

  return Source;
}

"mike"  wrote in message

>>> Can you point out what I am not understanding or where I have gone 
>>> wrong.
>>>
>>>
>>
>>
>
> 
Technical Details
Message-ID: <45a2963a$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: <459ebec4$1@newsgroups.borland.com> <459ec5bf$1@newsgroups.borland.com> <459fbc29$2@newsgroups.borland.com> <45a02189$1@newsgroups.borland.com> <45a02ab5$1@newsgroups.borland.com> <45a0c58e$1@newsgroups.borland.com> <45a0fe8a$1@newsgroups.borland.com> <45a10643$1@newsgroups.borland.com> <45a11e90$1@newsgroups.borland.com> <45a12e02@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,6ed59181280548e1
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Michael Harris" <techonos-NO-SPAM-@attbi.com>
From: "Michael Harris" <techonos-NO-SPAM-@attbi.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <459ebec4$1@newsgroups.borland.com> <459ec5bf$1@newsgroups.borland.com> <459fbc29$2@newsgroups.borland.com> <45a02189$1@newsgroups.borland.com> <45a02ab5$1@newsgroups.borland.com> <45a0c58e$1@newsgroups.borland.com> <45a0fe8a$1@newsgroups.borland.com> <45a10643$1@newsgroups.borland.com> <45a11e90$1@newsgroups.borland.com> <45a12e02@newsgroups.borland.com>
Subject: Re: Help with TCppWebBrowser - Find and click a button
Date: Mon, 8 Jan 2007 13:05:40 -0600
Lines: 67
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 76.187.71.134
Message-ID: <45a2963a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1168283194 76.187.71.134 (8 Jan 2007 11:06:34 -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