🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Queying WEB pages

#720
From: Remy Lebeau (TeamB)
Date: Wed, 25 Oct 2006 17:09
43 lines
2574 bytes
"Alim Akyol" <akyolalim@yahoo.com> wrote in message
news:xn0esw68cdluat000@forums.borland.com...

> Is there any component for this purpose?

There are several.  Indy (http://www.indyproject.org), ICS
(http://www.overbyte.be), and Synapse (http://www.ararat.cz/synapse) all
have HTTP client components available.  Or you can use Microsoft's WinInet
or WinHTTP APIs (Internet Explorer uses these internally).

> Can I use IHTMLDocument2 interface to load pages without
> using TWebBrowser?

You can try creating a standalone instance of the IHTMLDocument2 object and
then load HTML into the document as needed:

    IHTMLDocument2 *pDocument = NULL;

    if( SUCCEEDED(CoCreateInstance(CLSID_HTMLDocument, NULL,
CLSCTX_INPROC_SERVER, IID_IHTMLDocument2, (LPVOID*)&pDocument)) )
    {
        // use pDocument as needed ...
        pDocument->Release();
    }

However, without a valid browser to host the document, you will not be able
to directly navigate the document anywhere.  You would have to either
download the HTML manually and then load it into the IHTMLDocument2 via its
IPersistStreamInit interface, or else use CreateURLMoniker() to create a
moniker for a URL and then load it into the IHTMLDocument2 via its
IPersistMoniker interface.

> I could use TIdHTTP but I have a doubt about it. I don't want to
> parse pages, and handle frames, cookies, SSL pages, etc.

You will have to, using any of the above options, because they are all
one-resource-at-a-time downloaders, so you have to parse the HTML to figure
out which additional requests to make.  TWebBrowser (and thus IE) have to do
the same thing internally.


Gambit
Technical Details
Message-ID: <453f9a6a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.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
References: <xn0esw68cdluat000@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,dc54f5f83a00dec3
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: <xn0esw68cdluat000@forums.borland.com>
Subject: Re: Queying WEB pages
Date: Wed, 25 Oct 2006 10:09:20 -0700
Lines: 45
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: 69.169.4.232
Message-ID: <453f9a6a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1161796202 69.169.4.232 (25 Oct 2006 10:10:02 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.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