Article View: borland.public.cppbuilder.internet.web
Article #1069Re: Help with Delphi Translation
From: Remy Lebeau (TeamB)
Date: Thu, 29 Sep 2005 17:57
Date: Thu, 29 Sep 2005 17:57
47 lines
2813 bytes
2813 bytes
"mike" <mfbrowne@earthlink.nnet> wrote in message
news:43388d42$1@newsgroups.borland.com...
> OleCheck(Collection->item(WideString(""), 0, Disp));
<snip>
> When this is executed it never returns therefore the app is hung
> at this point. There is no exception reported.
The only thing I can think of is the blank item name that is being passed
in. That is very unusual to do, even for the original Pascal. Looking back
at it, I think the Pascal was trying to pass in an integer of 0, not a blank
string. In which case, the above line should be the following instead:
OleCheck(Collection->item(0, 0, Disp));
Now, with that said, since the collection traversal code is simply trying to
get an IHTMLElement for the <BODY> tag of a document, there is an easier
way - the IHTMLDocument2 interface has a body property that returns that
same IHTMLElement interface directly, ie:
#include <mshtml.hpp>
void __fastcall TForm1::acIESniffer1WBDownloadComplete(TObject *Sender,
const AnsiString URL, const IWebBrowser2 *Browser)
{
DelphiInterface<IHTMLDocument2> Doc;
DelphiInterface<IHTMLElement> Element;
_di_IDispatch Disp;
WideString HTMLPage;
WideString PlainText;
try
{
OleCheck(Browser->Get_Document(Disp));
Doc = Disp;
OleCheck(Doc->Get_Body(Element));
OleCheck(Element->Get_OuterHTML(HTMLPage));
OleCheck(Element->Get_OuterText(PlainText));
}
catch(const Exception &)
{
}
}
Gambit
Technical Details
Message-ID:
<433c2ae0$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.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> <43386fde$1@newsgroups.borland.com> <43388d42$1@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> <43386fde$1@newsgroups.borland.com> <43388d42$1@newsgroups.borland.com> Subject: Re: Help with Delphi Translation Date: Thu, 29 Sep 2005 10:57:17 -0700 Lines: 49 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: <433c2ae0$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1128016608 68.69.17.41 (29 Sep 2005 10:56:48 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail