๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Get the html content from WebBrowser

#373
From: Enrique
Date: Wed, 13 Dec 2006 16:01
65 lines
3092 bytes
Hi sam !

Here is the code that I use:
//-----------------------------------------------------------
AnsiString TInternetExplorer::CodigoFuenteHTML(TCppWebBrowser* 
CppWebBrowser1)
{
  AnsiString Source = "";

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


if(CppWebBrowser1->Document&&SUCCEEDED(CppWebBrowser1->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;
}
//------------------------------------------------------------------------

I now that it's more easy just ask to a group and wait for the answer, but 
if you give the custom of searching you will win much more than a code and a 
rapid solution for that unique and specific problem.

bye !
enrique.

"Hans Galema" <notused@notused.nl> escribi๏ฟฝ en el mensaje 
news:45801a0f@newsgroups.borland.com...
> sam wrote:
>
>> If you have the code for getting the complete file, you are welcome.
>
> Yes I have. And I told you how to find it.
>
> Hans. 
Technical Details
Message-ID: <458023a0@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.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: <457fbb89@newsgroups.borland.com> <45800fd4@newsgroups.borland.com> <458015ca$1@newsgroups.borland.com> <458017d1@newsgroups.borland.com> <45801a0f@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,7aeaf19e862fe0eb
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII
Reply-To: "Enrique" <enridp@yahoo.com.ar>
From: "Enrique" <enridp@yahoo.com.ar>
Newsgroups: borland.public.cppbuilder.internet.web
References: <457fbb89@newsgroups.borland.com> <45800fd4@newsgroups.borland.com> <458015ca$1@newsgroups.borland.com> <458017d1@newsgroups.borland.com> <45801a0f@newsgroups.borland.com>
Subject: Re: Get the html content from WebBrowser
Date: Wed, 13 Dec 2006 13:01:37 -0300
Lines: 67
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 200.45.165.95
Message-ID: <458023a0@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1166025632 200.45.165.95 (13 Dec 2006 08:00:32 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.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