🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
5 messages
5 total messages Started by billaras Fri, 11 Feb 2005 08:44
using tcppwebbrowser
#1408
Author: billaras
Date: Fri, 11 Feb 2005 08:44
2 lines
1020 bytes
how can i save a html page that i just viewed in my tcppwebbrowser
component?
Re: using tcppwebbrowser
#1409
Author: Hans Galema
Date: Fri, 11 Feb 2005 08:55
9 lines
1228 bytes
billaras wrote:
> how can i save a html page that i just viewed in my tcppwebbrowser
> component?

If you do an advanced newsgroups search with google for
�CppWebBrowser save source� for newsgroups *cppbuilder* then
you will get many answers.

Hans.
Re: using tcppwebbrowser
#1410
Author: billaras
Date: Fri, 11 Feb 2005 09:33
62 lines
2955 bytes
i have coppied this code
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  CppWebBrowser1->Navigate(WideString("http://192.168.1.3/index.htm"));
AnsiString Source = "";

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


if(CppWebBrowser1->Document&&SUCCEEDED(CppWebBrowser1->Document->QueryInterf
ace(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();
    }
    Memo1->Lines->Text = Source;

}
//--------------------------------------------------------------------------
-
the only problem is that when i first click the button the page loads in the
tcppwebbrowser but not in the memo..on the second click it loads also in the
memo..why?
? "Hans Galema" <notused@notused.nl> ?????? ??? ??????
news:420c733b$1@newsgroups.borland.com...
> billaras wrote:
> > how can i save a html page that i just viewed in my tcppwebbrowser
> > component?
>
> If you do an advanced newsgroups search with google for
> �CppWebBrowser save source� for newsgroups *cppbuilder* then
> you will get many answers.
>
> Hans.
Re: using tcppwebbrowser
#1411
Author: Hans Galema
Date: Fri, 11 Feb 2005 09:37
10 lines
1443 bytes
billaras wrote:

> the only problem is that when i first click the button the page loads in the
> tcppwebbrowser but not in the memo..on the second click it loads also in the
> memo..why?

Your timing is wrong. You should use the OnDocumentComplete event
to get the source.

Hans.
Re: using tcppwebbrowser
#1412
Author: billaras
Date: Fri, 11 Feb 2005 09:59
15 lines
1461 bytes
thanks it worked perfectly..
? "Hans Galema" <notused@notused.nl> ?????? ??? ??????
news:420c7d20$1@newsgroups.borland.com...
> billaras wrote:
>
> > the only problem is that when i first click the button the page loads in
the
> > tcppwebbrowser but not in the memo..on the second click it loads also in
the
> > memo..why?
>
> Your timing is wrong. You should use the OnDocumentComplete event
> to get the source.
>
> Hans.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads