🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
20 messages
20 total messages Started by caleb Thu, 09 Mar 2006 14:11
How to get innerHTML for body of TCppWebBrowser Doc
#757
Author: caleb
Date: Thu, 09 Mar 2006 14:11
7 lines
974 bytes
What would I do to get the innerHTML for the body of the 
browser?

Thanks,

Caleb
Re: How to get innerHTML for body of TCppWebBrowser Doc
#758
Author: caleb
Date: Thu, 09 Mar 2006 15:03
25 lines
1519 bytes
Hans Galema <notused@notused.nl> wrote:
>caleb wrote:
>> What would I do to get the innerHTML for the body of the 
>> browser?
>
>http://www.google.nl/advanced_group_search?hl=en
>
>Ans fill in:
>with all of the words: innerhtml
>Group: *cppbuilder*
>
>Hans.

Sorry Hans.

Kind of a late night.

I am able to get the body html now but when assigning it to an
AnsiString the string still truncates it while if I show 
message the body  control it shows the whole body html.

I have tried removing all \r and \n chars from the stringlist 
when saving it to file -- are there any other chars that might 
truncate the AnsiString?
Re: How to get innerHTML for body of TCppWebBrowser Doc
#760
Author: caleb
Date: Thu, 09 Mar 2006 15:14
21 lines
1446 bytes

>>Hans.
>
>Sorry Hans.
>
>Kind of a late night.
>
>I am able to get the body html now but when assigning it to an
>AnsiString the string still truncates it while if I show 
>message the body  control it shows the whole body html.
>
>I have tried removing all \r and \n chars from the stringlist 
>when saving it to file -- are there any other chars that might 
>truncate the AnsiString?

To clarify -- if I use IDE to inspect the StringLIst I can see that it has whole documnet.  but this:

AnsiString doc = tSTrLst->Text;

will not put the whole document in 'doc'.
Re: How to get innerHTML for body of TCppWebBrowser Doc
#759
Author: Hans Galema
Date: Thu, 09 Mar 2006 15:46
11 lines
1229 bytes
caleb wrote:
> What would I do to get the innerHTML for the body of the 
> browser?

http://www.google.nl/advanced_group_search?hl=en

Ans fill in:
with all of the words: innerhtml
Group: *cppbuilder*

Hans.
Re: How to get innerHTML for body of TCppWebBrowser Doc
#761
Author: Hans Galema
Date: Thu, 09 Mar 2006 17:54
24 lines
1797 bytes
caleb wrote:

> To clarify -- if I use IDE to inspect the StringLIst I can see that it has whole documnet.  but this:

What code do you use to get it in a TStringList ?

> AnsiString doc = tSTrLst->Text;
> 
> will not put the whole document in 'doc'.


Did you write also (in anothe rpost) that you could save it to file
and that it showed ok in notepad ? Well then you can get all.

The only problem then is that loading a file in a TStringList
would truncate lines.

Well if you dont give an example it is hard to convince us.
Moreover: at wich length is the truncation ?

Post the file in the attachmentsgroup and post the code that
demonstrates the truncation.

Hans.
Re: How to get innerHTML for body of TCppWebBrowser Doc
#763
Author: caleb
Date: Thu, 09 Mar 2006 18:54
10 lines
1253 bytes
Hans Galema <notused@notused.nl> wrote:
>caleb wrote:
>
>> To clarify -- if I use IDE to inspect the StringLIst I can see that it has whole documnet.  but this:
>
>What code do you use to get it in a TStringList ?
>

tSTrLst->LoadFromFile(fname);
Re: How to get innerHTML for body of TCppWebBrowser Doc
#764
Author: caleb
Date: Thu, 09 Mar 2006 18:59
18 lines
1476 bytes
Hans Galema <notused@notused.nl> wrote:

>
>Well if you dont give an example it is hard to convince us.
>Moreover: at wich length is the truncation ?
>
>Post the file in the attachmentsgroup and post the code that
>demonstrates the truncation.
>
>Hans.

It is posted as "File for hans galema".

http://newsgroups.borland.com/cgi-bin/dnewsweb?cmd=article&group=borland.public.attachments&item=10014&utag=

I could not see how to upload the file from borland site
newsroup viewer.
Re: How to get innerHTML for body of TCppWebBrowser Doc
#768
Author: caleb
Date: Thu, 09 Mar 2006 20:05
18 lines
1538 bytes
Hans Galema <notused@notused.nl> wrote:
>Hans Galema wrote:
>
>> And you have to tell which line truncates.
>
>Or does the file truncate ?
>
>So is this a problem that from many lines, one line -say in the middle- is
>truncated? Or does the stringlist load only part of the file ?
>If the latter Mark may be right in the byte with value zero.
>
>You could have given this info already.
>
>Hans.


What does a null character look like?
Re: How to get innerHTML for body of TCppWebBrowser Doc
#769
Author: caleb
Date: Thu, 09 Mar 2006 20:08
21 lines
1617 bytes
Hans Galema <notused@notused.nl> wrote:
>Hans Galema wrote:
>
>> And you have to tell which line truncates.
>
>Or does the file truncate ?
>
>So is this a problem that from many lines, one line -say in the middle- is
>truncated? Or does the stringlist load only part of the file ?
>If the latter Mark may be right in the byte with value zero.
>
>You could have given this info already.
>
>Hans.

The stringlist has the whole file.

the text property does not and it gets chopped off in arbitrary
fashion.  for example "...#cccccc" will appear as "...#cc" in 
the text property.
Re: How to get innerHTML for body of TCppWebBrowser Doc
#766
Author: Hans Galema
Date: Thu, 09 Mar 2006 20:20
26 lines
2022 bytes
caleb wrote:

> It is posted as "File for hans galema".
> 
> http://newsgroups.borland.com/cgi-bin/dnewsweb?cmd=article&group=borland.public.attachments&item=10014&utag=
> 
> I could not see how to upload the file from borland site
> newsroup viewer.

That makes no sense. The contents of the file is in between <pre></pre>
One finds "&lt;html&gt;&lt;head&gt;" instead of "<html><head>".

I will not do anything with that.

Why can't you upload the file to attachments ?
borland.public.attachments

Well you did also. But as plain/text. Please post again with the file as
attachment.

And you have to tell which line truncates. And if you know which one then why not
post a smaller file with only that line? Makes it easier to investigate.

Html files can have very long lines. Is it a very long line that truncates ?

Hans.
Re: How to get innerHTML for body of TCppWebBrowser Doc
#765
Author: Mark Guerrieri
Date: Thu, 09 Mar 2006 20:31
35 lines
2267 bytes
Could there be a NULL character embedded in the file?  That would cause the 
AnsiString to be truncated...

Mark

"Hans Galema" <notused@notused.nl> wrote in message 
news:44108edc@newsgroups.borland.com...
> caleb wrote:
>
>> It is posted as "File for hans galema".
>>
>> http://newsgroups.borland.com/cgi-bin/dnewsweb?cmd=article&group=borland.public.attachments&item=10014&utag=
>>
>> I could not see how to upload the file from borland site
>> newsroup viewer.
>
> That makes no sense. The contents of the file is in between <pre></pre>
> One finds "&lt;html&gt;&lt;head&gt;" instead of "<html><head>".
>
> I will not do anything with that.
>
> Why can't you upload the file to attachments ?
> borland.public.attachments
>
> Well you did also. But as plain/text. Please post again with the file as
> attachment.
>
> And you have to tell which line truncates. And if you know which one then 
> why not
> post a smaller file with only that line? Makes it easier to investigate.
>
> Html files can have very long lines. Is it a very long line that truncates 
> ?
>
> Hans. 
Re: How to get innerHTML for body of TCppWebBrowser Doc
#767
Author: Hans Galema
Date: Thu, 09 Mar 2006 20:41
13 lines
1577 bytes
Hans Galema wrote:

> And you have to tell which line truncates.

Or does the file truncate ?

So is this a problem that from many lines, one line -say in the middle- is
truncated? Or does the stringlist load only part of the file ?
If the latter Mark may be right in the byte with value zero.

You could have given this info already.

Hans.
Re: How to get innerHTML for body of TCppWebBrowser Doc
#770
Author: Remy Lebeau (TeamB)
Date: Thu, 09 Mar 2006 21:11
10 lines
1298 bytes
"caleb" <n@spam.com> wrote in message
news:44109894$1@newsgroups.borland.com...

> What does a null character look like?

Decimal zero.


Gambit
Re: How to get innerHTML for body of TCppWebBrowser Doc
#775
Author: Hans Galema
Date: Fri, 10 Mar 2006 07:55
31 lines
2228 bytes
caleb wrote:

> The stringlist has the whole file.

How did you check ?

> the text property does not and it gets chopped off in arbitrary
> fashion.  for example "...#cccccc" will appear as "...#cc" in 
> the text property.

Arbitrary ? And only once ? On a very long line ?

And after that ? So the Text property only contains the first piece
of the file ?

Can you reproduce the problem with a smaller file ?

If you would post that file as attachment in borland.public.attachments
we could have a look.

If the file contains a null character then that means that there is
a byte with the value 0. So if you examined the file with a
hexediter you would see 0x00. If you would load the file in memory
you could use strlen() to determine if there is a null char.

  char *text = loadfileinmemory ( path, &filelen );

  if ( strlen(text) != filelen )
	ShowMessage ( "file contains null char");

Hans.
Re: How to get innerHTML for body of TCppWebBrowser Doc
#777
Author: caleb
Date: Fri, 10 Mar 2006 10:39
11 lines
1332 bytes
Hans Galema <notused@notused.nl> wrote:
>caleb wrote:
>
>> The stringlist has the whole file.
>
>How did you check ?

Inspected it in IDE as mentioned.

Thanks for your respomse.
HANS G Re: How to get innerHTML for body of TCppWebBrowser Doc
#776
Author: caleb
Date: Fri, 10 Mar 2006 10:44
18 lines
1696 bytes
Hans Galema <notused@notused.nl> wrote:

>If the file contains a null character then that means that there is
>a byte with the value 0. So if you examined the file with a
>hexediter you would see 0x00. If you would load the file in memory
>you could use strlen() to determine if there is a null char.
>
>  char *text = loadfileinmemory ( path, &filelen );
>
>  if ( strlen(text) != filelen )
>	ShowMessage ( "file contains null char");
>
>Hans.

What do you if this is the case to remove the null char(s)?

Thanks
Re: How to get innerHTML for body of TCppWebBrowser Doc
#779
Author: caleb
Date: Fri, 10 Mar 2006 10:46
19 lines
1660 bytes
Hans Galema <notused@notused.nl> wrote:

>Arbitrary ? And only once ? On a very long line ?
>
>And after that ? So the Text property only contains the first piece
>of the file ?
>
>Can you reproduce the problem with a smaller file ?
>
>If you would post that file as attachment in borland.public.attachments
>we could have a look.


What do you do to remove the null char?

It is arbitrary I guess, every time, pretty long line.

I posted the file as you asked as "for hans galema"
Re: HANS G Re: How to get innerHTML for body of TCppWebBrowser Doc
#778
Author: Hans Galema
Date: Fri, 10 Mar 2006 11:52
25 lines
1864 bytes
caleb wrote:

>> char *text = loadfileinmemory ( path, &filelen );
>>
>> if ( strlen(text) != filelen )
>>	ShowMessage ( "file contains null char");

> What do you if this is the case to remove the null char(s)?

Replace them by spaces.

  char *ptr = text;

  int len = filelen;

  while ( --len )
	{
	if ( !*ptr ) *ptr = ' ';
         ptr++;
         }

I start vaguely to remember that there were indeed null chars in a html-page
that I once grabbed from amazone.com.

Hans.
Re: How to get innerHTML for body of TCppWebBrowser Doc
#780
Author: Hans Galema
Date: Fri, 10 Mar 2006 11:54
11 lines
1645 bytes
caleb wrote:

> I posted the file as you asked as "for hans galema"

No. I asked to post it as attachment. Instead it is as text in the body of
the message. That makes no sence as your emailposter may have removed
null chars or otherwise my mailreader.

So attach it please.

Hans.
Re: How to get innerHTML for body of TCppWebBrowser Doc
#781
Author: caleb
Date: Sun, 12 Mar 2006 23:12
25 lines
1891 bytes
Hans Galema <notused@notused.nl> wrote:
>caleb wrote:
>
>> I posted the file as you asked as "for hans galema"
>
>No. I asked to post it as attachment. Instead it is as text in the body of
>the message. That makes no sence as your emailposter may have removed
>null chars or otherwise my mailreader.
>
>So attach it please.
>
>Hans.


Hi Hans :

I could not see a way to post attachement from BDN newsgroups
on borland web site.

Anyway I was under gun so to speak and the null chars seemed
to occur in parts of page that I was not processing and ended 
parsing TLines in TStringList.

Thank you for code on replacing null characters.
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