Article View: borland.public.cppbuilder.internet.web
Article #1053Re: Help with Delphi Translation
From: Remy Lebeau (TeamB)
Date: Sat, 24 Sep 2005 20:20
Date: Sat, 24 Sep 2005 20:20
49 lines
2337 bytes
2337 bytes
"mike" <mfbrowne@earthlink.nnet> wrote in message
news:43359db7@newsgroups.borland.com...
> Could someone help me with translating this deph code into Builder5 code.
#include <ComObj.hpp>
#include <utilcls.h>
void __fastcall TForm1::acIESniffer1WBDownloadComplete(TObject *Sender,
const AnsiString URL, const IWebBrowser2 *Browser)
{
TComInterface<IHTMLDocument2> Doc;
TComInterface<IHTMLElementCollection> Collection;
TComInterface<IHTMLElement> Element;
TComInterface<IDispatch> Disp;
WideString HTMLPage;
WideString PlainText;
try
{
OleCheck(Browser->get_Document(&Disp));
OleCheck(Disp->QueryInterface(IID_IHTMLDocument2,
(LPVOID*)&Doc));
Disp.Unbind();
OleCheck(Doc->get_all(&Collection));
OleCheck(Collection->tags(TVariant(WideString("BODY")), &Disp));
Collection.Unbind();
OleCheck(Disp->QueryInterface(IID_IHTMLElementCollection,
(LPVOID*)&Collection));
Disp.Unbind();
OleCheck(Collection->item(TVariant(WideString("")), TVariant(0),
&Disp));
OleCheck(Disp->QueryInterface(IID_IHTMLElement,
(LPVOID*)&Element));
Disp.Unbind();
OleCheck(Element->get_outerHTML(&HTMLPage));
OleCheck(Element->get_outerText(&PlainText));
}
catch(const Exception &)
{
}
}
Gambit
Technical Details
Message-ID:
<4335b4c4$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<43359db7@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,5d71e42a8af639c6 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: <43359db7@newsgroups.borland.com> Subject: Re: Help with Delphi Translation Date: Sat, 24 Sep 2005 13:20:16 -0700 Lines: 51 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: 68.69.17.41 Message-ID: <4335b4c4$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1127593156 68.69.17.41 (24 Sep 2005 13:19:16 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail