Article View: borland.public.cppbuilder.internet.web
Article #1054Re: Help with Delphi Translation
From: mike
Date: Sun, 25 Sep 2005 15:19
Date: Sun, 25 Sep 2005 15:19
99 lines
4680 bytes
4680 bytes
Remy,
Thank you very much for answering me I sure do appreciate it. I tried to use
the code you supplied and I have received the following errors. Is there any
chance you could help me with these to get this working.
Again thanks very mech.
Mike
[C++ Warning] Unit1.cpp(45): W8037 Non-const function __stdcall
IWebBrowser::Get_Document(_di_IDispatch &) called for const object
[C++ Warning] Unit1.cpp(45): W8030 Temporary used for parameter
'Get_Document_result' in call to '__stdcall
IWebBrowser::Get_Document(_di_IDispatch &)'
[C++ Error] Unit1.cpp(45): E2064 Cannot initialize '_di_IDispatch &' with
'IDispatch * *'
[C++ Error] Unit1.cpp(45): E2342 Type mismatch in parameter
'Get_Document_result' (wanted '_di_IDispatch &', got 'IDispatch * *')
[C++ Error] Unit1.cpp(50): E2316 'get_all' is not a member of
'IHTMLDocument2'
[C++ Error] Unit1.cpp(51): E2034 Cannot convert 'TVariant' to 'OleVariant'
[C++ Warning] Unit1.cpp(51): W8030 Temporary used for parameter
'tags_result' in call to '__stdcall IHTMLElementCollection::tags(const
OleVariant,_di_IDispatch &)'
[C++ Error] Unit1.cpp(51): E2064 Cannot initialize '_di_IDispatch &' with
'IDispatch * *'
[C++ Error] Unit1.cpp(51): E2342 Type mismatch in parameter 'tags_result'
(wanted '_di_IDispatch &', got 'IDispatch * *')
[C++ Error] Unit1.cpp(58): E2034 Cannot convert 'TVariant' to 'OleVariant'
[C++ Error] Unit1.cpp(58): E2034 Cannot convert 'TVariant' to 'OleVariant'
[C++ Warning] Unit1.cpp(58): W8030 Temporary used for parameter
'item_result' in call to '__stdcall IHTMLElementCollection::item(const
OleVariant,const OleVariant,_di_IDispatch &)'
[C++ Error] Unit1.cpp(58): E2064 Cannot initialize '_di_IDispatch &' with
'IDispatch * *'
[C++ Error] Unit1.cpp(58): E2342 Type mismatch in parameter 'item_result'
(wanted '_di_IDispatch &', got 'IDispatch * *')
[C++ Error] Unit1.cpp(63): E2316 'get_outerHTML' is not a member of
'IHTMLElement'
[C++ Error] Unit1.cpp(64): E2316 'get_outerText' is not a member of
'IHTMLElement'
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:4335b4c4$1@newsgroups.borland.com...
>
> "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:
<4336bfa0$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!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>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,5d71e42a8af639c6 X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit From: "mike" <mfbrowne@earthlink.nnet> Newsgroups: borland.public.cppbuilder.internet.web References: <43359db7@newsgroups.borland.com> <4335b4c4$1@newsgroups.borland.com> Subject: Re: Help with Delphi Translation Date: Sun, 25 Sep 2005 11:19:37 -0400 Lines: 101 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 68.204.189.169 Message-ID: <4336bfa0$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1127661472 68.204.189.169 (25 Sep 2005 08:17:52 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail