|
-
July 11th, 2011, 01:20 AM
#1
preserve color
I have an richedit control on my dialog,
wen I paste the copied formatted text in my clipboard on it, the text format is preserved,
But if I put it in a CString variable, and paste it on the control, the colors go away, even when I use streamin/out to do that.
Sig-na-tju-(r)
-
July 11th, 2011, 09:30 AM
#2
Re: preserve color
CString class has no idea what the color is. It only works with TCHAR arrays.
Victor Nijegorodov
-
July 11th, 2011, 09:55 AM
#3
Re: preserve color
 Originally Posted by ThachQuanVy
I have an richedit control on my dialog,
wen I paste the copied formatted text in my clipboard on it, the text format is preserved,
But if I put it in a CString variable, and paste it on the control, the colors go away, even when I use streamin/out to do that.
HOW do you put content from clipboard into your CString?
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
-
July 11th, 2011, 09:57 AM
#4
Re: preserve color
 Originally Posted by VictorN
CString class has no idea what the color is. It only works with TCHAR arrays.
But that array can contain rtf with color information in it.
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
-
July 11th, 2011, 06:39 PM
#5
Re: preserve color
 Originally Posted by ThachQuanVy
...But if I put it in a CString variable, and paste it on the control, the colors go away, even when I use streamin/out to do that.
Be certain that your CString has the correct RTF codes in it. See the following for the current RTF format codes: "Rich Text Format (RTF) Specification, version 1.9.1" at http://www.microsoft.com/download/en...ng=en&id=10725
And when using streamin, be certain that you use the SF_RTF flag, and not the SF_TEXT flag.
Mike
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|