Article View: borland.public.cppbuilder.internet.web
Article #1410Re: using tcppwebbrowser
From: billaras
Date: Fri, 11 Feb 2005 09:33
Date: Fri, 11 Feb 2005 09:33
62 lines
2955 bytes
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.
Technical Details
Message-ID:
<420c7bde$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<420c7062$1@newsgroups.borland.com> <420c733b$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,2e0b94089ea2dbf X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII Reply-To: "billaras" <billaras1234@hotmail.com> From: "billaras" <billaras1234@hotmail.com> Newsgroups: borland.public.cppbuilder.internet.web References: <420c7062$1@newsgroups.borland.com> <420c733b$1@newsgroups.borland.com> Subject: Re: using tcppwebbrowser Date: Fri, 11 Feb 2005 11:33:29 +0200 Lines: 64 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: 195.251.45.43 Message-ID: <420c7bde$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1108114398 195.251.45.43 (11 Feb 2005 01:33:18 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail