Re: Converting text to Rich Text Format

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



OK, the details are

Version 5.30.12.1211 8/29/2002 6:40am shows the error based on a misinterpretation of CRLF
sequences
Version 5.30.12.1221 8/4/2004 3:56am does not have the error

The timestamps are those reported by the "Show Modules" debug WIndow in VS.NET 2003.

So it apparently matters which version of DLL you are using. I'm going to have to put a
test in to make sure that I do the right compensation. I have to check to see if Riched20
is redistributable. My recollection was that it wasn't.
joe
On Sat, 09 Sep 2006 15:52:20 -0400, Joseph M. Newcomer <newcomer@xxxxxxxxxxxx> wrote:

What is really strange is that on my laptop I *don't* get the creep. I was just out
somewhere where my role had been to provide transportation, but I had nothing to do. I
noticed the "inverse creep". I will compare control DLL versions and report back when I
have my laptop up again.

I suspected that, but when I replaced \r\n with just \n, the text looks the same (unlike
an ordinary CEdit) but the count is still wrong.
joe


On Sat, 09 Sep 2006 00:19:11 -0700, "Mihai N." <nmihai_year_2000@xxxxxxxxx> wrote:
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.
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Converting text to Rich Text Format
    ... I will compare control DLL versions and report back when I ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: Converting text to Rich Text Format
    ... I will compare control DLL versions and report back when I ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: And Steve Goldman chimes in on the MVP vote
    ... THE DUMBEST MVP VOTE IN THE HISTORY OF CIVILIZATION, ... INFAMOUS 112 CE ROMAN EASTERN CHARIOT LEAGUE VOTE AND THE 1,000,276 CE ... Not only did the writers vote for the wrong player, ... Joe Mauer, the first catcher in the history of the ...
    (alt.sports.baseball.ny-yankees)
  • Re: Read a file from network share!
    ... perhaps an issue about how the win16 emulator runs. ... I do have the command and that is under ... MVP Tips:http://www.flounder.com/mvp_tips.htm-Hidequotedtext- ...
    (microsoft.public.vc.mfc)
  • Re: MFC Goldmine site updated
    ... That is what oll of those "killfilers" say, ... while following the articles they have killfiled. ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)