🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #383

Re: How to get the "real live" HTML source?

#383
From: Enrique
Date: Tue, 19 Dec 2006 15:41
54 lines
2935 bytes
I really thank your help Gambit, it was very useful.
And yes, I need more practice with these interfaces, but in C++ it seems so 
complicated... we can see it just viewing the
translation to C++ of the really simple code in Delphi... why it's so 
different? MSDN design its interfaces thinking in Object Pascal?
I will work around your code and MSDN to reach the a version of the 
"HTMLRealLiveSource" (at least I will try to do it).

thanks !
enrique.

PD: I have a basic question, because I use it but I don't know what I'm 
doing at really...
QueryInterface is like a typecasting?
I mean...

In delhpi we can do this:
//--------------
element:IHTMLElement;
(...)
childrenElements: IHTMLElementCollection;
childrenElements:= element.children as IHTMLElementCollection;
//-----------------
***********************************
But in C++ this doesn't work:
//--------------
IHTMLElement element;
(...)
IHTMLElementCollection childrenElements;
childrenElements = (IHTMLElementCollection)element.children;
//--------------
***********************************
neither:
//--------------
IHTMLElement *element;
(...)
IHTMLElementCollection *childrenElements;
childrenElements = dynamic_cast<IHTMLElementCollection*>(element->children);
//--------------
***********************************
as a matter of fact we must do something like this:
//--------------
IHTMLElement *element;
(...)
TComInterface<IDispatch> disp;
element->get_children(&disp);
if( disp )
{
  TComInterface<IHTMLElementCollection> childrenElements;
  disp->QueryInterface(IID_IHTMLElementCollection, 
(LPVOID*)&childrenElements);
//--------------
************************************
it's really much more abstract (to me) to understand it...
Technical Details
Message-ID: <4588092d@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.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
References: <4582e657@newsgroups.borland.com> <4582eb35$1@newsgroups.borland.com> <45831d53@newsgroups.borland.com> <4583480c$1@newsgroups.borland.com> <45834aa4$1@newsgroups.borland.com> <4583eee0@newsgroups.borland.com> <4586f05a$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,b54437b3b496861e
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Enrique" <enridp@yahoo.com.ar>
From: "Enrique" <enridp@yahoo.com.ar>
Newsgroups: borland.public.cppbuilder.internet.web
References: <4582e657@newsgroups.borland.com> <4582eb35$1@newsgroups.borland.com> <45831d53@newsgroups.borland.com> <4583480c$1@newsgroups.borland.com> <45834aa4$1@newsgroups.borland.com> <4583eee0@newsgroups.borland.com> <4586f05a$1@newsgroups.borland.com>
Subject: Re: How to get the "real live" HTML source?
Date: Tue, 19 Dec 2006 12:41:14 -0300
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 200.43.204.157
Message-ID: <4588092d@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1166543149 200.43.204.157 (19 Dec 2006 07:45:49 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.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