🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
6 messages
6 total messages Started by Metro Thu, 29 Dec 2005 16:59
Intercept TCppWebBrowser
#935
Author: Metro
Date: Thu, 29 Dec 2005 16:59
8 lines
1189 bytes
I am looking for a way to intercept and modify the html stream as it is 
received but not one page its a constant stream that is received.

Some one please let me know if its possible and maybe a small sample to 
explain how to do it, even the correct event i could use would be most 
helpfull.

Thanks. 
Re: Intercept TCppWebBrowser
#836
Author: Remy Lebeau (TeamB)
Date: Thu, 29 Dec 2005 18:57
13 lines
1343 bytes
"Metro" <metro9999@lycos.co.uk.nospam> wrote in message
news:43b41563@newsgroups.borland.com...

> I am looking for a way to intercept and modify the html stream as
> it is received but not one page its a constant stream that is received.

You cannot intercept the data that TCppWebBrowser receives.  You will have
to download the data yourself separately, then modify it as needed, and then
lastly load it into the TCppWebBrowser for displaying.


Gambit
Re: Intercept TCppWebBrowser
#837
Author: Metro
Date: Thu, 29 Dec 2005 19:45
21 lines
1759 bytes
Would i be correct in thinking loading the html using clientsocket into a 
memo and loading the memo into tccpwebbrowser ?

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:43b432de$1@newsgroups.borland.com...
>
> "Metro" <metro9999@lycos.co.uk.nospam> wrote in message
> news:43b41563@newsgroups.borland.com...
>
>> I am looking for a way to intercept and modify the html stream as
>> it is received but not one page its a constant stream that is received.
>
> You cannot intercept the data that TCppWebBrowser receives.  You will have
> to download the data yourself separately, then modify it as needed, and 
> then
> lastly load it into the TCppWebBrowser for displaying.
>
>
> Gambit
>
> 
Re: Intercept TCppWebBrowser
#839
Author: Remy Lebeau (TeamB)
Date: Thu, 29 Dec 2005 21:35
19 lines
1767 bytes
"Metro" <metro9999@lycos.co.uk.nospam> wrote in message
news:43b43c62@newsgroups.borland.com...

> Would i be correct in thinking loading the html using clientsocket
> into a memo and loading the memo into tccpwebbrowser ?

You do not need to use a Memo.  Use a TMemoryStream instead.  You can use
TStreamAdapter to pass the TMemoryStream to the TCppWebBrowser's
IPersistStreamInit interface.  Search the newsgroup archives at
http://www.deja.com for examples.

And I would not suggest using TClientSocket.  HTTP is a complex protocol to
implement from scratch.  You should use an actual HTTP component, such as
the one found in Indy, ICS, Synapse, or any number of other third-party
implementation.  Or use the WinInet or WinHTTP API from Microsoft.


Gambit
Re: Intercept TCppWebBrowser
#841
Author: Metro
Date: Fri, 30 Dec 2005 09:41
29 lines
2224 bytes
Would this allow me to change the html in the stream as it comes in ? this 
is why i was looking to use the memo control so i can see the stream and 
record it so i can modify the stream as required once the memo has saved the 
recorded stream..

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:43b4560a@newsgroups.borland.com...
>
> "Metro" <metro9999@lycos.co.uk.nospam> wrote in message
> news:43b43c62@newsgroups.borland.com...
>
>> Would i be correct in thinking loading the html using clientsocket
>> into a memo and loading the memo into tccpwebbrowser ?
>
> You do not need to use a Memo.  Use a TMemoryStream instead.  You can use
> TStreamAdapter to pass the TMemoryStream to the TCppWebBrowser's
> IPersistStreamInit interface.  Search the newsgroup archives at
> http://www.deja.com for examples.
>
> And I would not suggest using TClientSocket.  HTTP is a complex protocol 
> to
> implement from scratch.  You should use an actual HTTP component, such as
> the one found in Indy, ICS, Synapse, or any number of other third-party
> implementation.  Or use the WinInet or WinHTTP API from Microsoft.
>
>
> Gambit
>
> 
Re: Intercept TCppWebBrowser
#844
Author: Remy Lebeau (TeamB)
Date: Fri, 30 Dec 2005 21:37
20 lines
1774 bytes
"Metro" <metro9999@lycos.co.uk.nospam> wrote in message
news:43b521a2$1@newsgroups.borland.com...

> Would this allow me to change the html in the stream as it comes in ?

Yes.  But you won't be able to load it into the TCppWebBrowser until you
have all of the data available.  You can't do manual real-time streaming
into TCppWebBrowser.  If you need that, then you will have to implement a
proxy server instead.

> this is why i was looking to use the memo control so i can see the stream
> and record it so i can modify the stream as required once the memo has
> saved the recorded stream..

You can do the same thing with TMemoryStream, or any other kind of stream
that you want to use.


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads