Article View: borland.public.cppbuilder.internet.web
Article #1061Re: Help with Delphi Translation
From: Remy Lebeau (TeamB)
Date: Mon, 26 Sep 2005 22:03
Date: Mon, 26 Sep 2005 22:03
58 lines
2836 bytes
2836 bytes
"mike" <mfbrowne@earthlink.nnet> wrote in message
news:43384404@newsgroups.borland.com...
> If I include the mshtml.h I receive a whole bunch of duplicate
declarations.
Which, again, suggests that your code is not using the original Microsoft
interfaces to begin with, but instead is using VCL translations of them.
> I do include a mshtml.hpp
Exactly. Any hpp file is a VCL header file.
> if I don't then I don'tget anywhere using the control.
Then it sounds like you cannot use the Microsoft interfaces directly at all.
Which means the code will have to be adjusted accordingly. Since I know
nothiing about AppControls or IESniffer, I can only guess at the necessary
changes, as follows:
#include <mshtml.hpp>
void __fastcall TForm1::acIESniffer1WBDownloadComplete(TObject *Sender,
const AnsiString URL, const IWebBrowser2 *Browser)
{
DelphiInterface<IHTMLDocument2> Doc;
DelphiInterface<IHTMLElementCollection> Collection;
DelphiInterface<IHTMLElement> Element;
_di_IDispatch Disp;
WideString HTMLPage;
WideString PlainText;
try
{
OleCheck(Browser->Get_Document(Disp));
Doc = Disp;
Disp.Release();
OleCheck(Doc->Get_All(Collection));
OleCheck(Collection->tags(WideString("BODY"), Disp));
Collection = Disp;
Disp.Release();
OleCheck(Collection->item(WideString(""), 0, Disp));
Element = Disp;
Disp.Release();
OleCheck(Element->Get_OuterHTML(HTMLPage));
OleCheck(Element->Get_OuterText(PlainText));
}
catch(const Exception &)
{
}
}
Gambit
Technical Details
Message-ID:
<43386fde$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<43359db7@newsgroups.borland.com> <4335b4c4$1@newsgroups.borland.com> <4336bfa0$1@newsgroups.borland.com> <43382c29$1@newsgroups.borland.com> <43384404@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> <4335b4c4$1@newsgroups.borland.com> <4336bfa0$1@newsgroups.borland.com> <43382c29$1@newsgroups.borland.com> <43384404@newsgroups.borland.com> Subject: Re: Help with Delphi Translation Date: Mon, 26 Sep 2005 15:03:04 -0700 Lines: 60 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: <43386fde$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1127772126 68.69.17.41 (26 Sep 2005 15:02:06 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail