Re: Converting text to Rich Text Format
- From: "Mihai N." <nmihai_year_2000@xxxxxxxxx>
- Date: Sat, 09 Sep 2006 00:19:11 -0700
There is a "creep" where the SetSelection selects the wrong text depending
on how many
lines precede the text. No, I don't know what is wrong here, and there
appears to be no
documentation about the problem, but I noticed that the colors were slowly
moving to the right.
I'm not sure this will work correctly in the presence of line wrap, but all
my output fits on one line at the moment.
Some time ago I have noticed that a "\r\n" (0d 0a) in the original string
ends up counted as one character in the RTF (probably the \par).
So:
rtfControl.AddString( "a\r\n" );
rtfControl.AddString( "b\r\n" );
rtfControl.AddString( "c\r\n" );
means a#b#c# (# = "paragraph character", whatever that is in the belly of the
rtf control.) So trying to select the first line (length 3, in the original
text) will end up selecting a#b
And the more lines you have, the worse it gets :-)
I am not sure if this is your case, but I though it is worth mentioning.
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
.
- Follow-Ups:
- Re: Converting text to Rich Text Format
- From: Joseph M . Newcomer
- Re: Converting text to Rich Text Format
- References:
- Converting text to Rich Text Format
- From: Peter Olcott
- Re: Converting text to Rich Text Format
- From: Joseph M . Newcomer
- Re: Converting text to Rich Text Format
- From: Peter Olcott
- Re: Converting text to Rich Text Format
- From: Joseph M . Newcomer
- Re: Converting text to Rich Text Format
- From: Peter Olcott
- Re: Converting text to Rich Text Format
- From: Joseph M . Newcomer
- Re: Converting text to Rich Text Format
- From: Peter Olcott
- Re: Converting text to Rich Text Format
- From: Joseph M . Newcomer
- Converting text to Rich Text Format
- Prev by Date: International String and Font Issue in Windows 2000......
- Next by Date: edit box to file
- Previous by thread: Re: Converting text to Rich Text Format
- Next by thread: Re: Converting text to Rich Text Format
- Index(es):