K
kris
Hi,
Our application has a richedit control which has a wmf picture and
some text.
I read the text from rich edit control and save it as a .rtf file. RTF
file opens correctly but opening the RTF file in notepad shows
incorrect syntax of the external picture "control word" on Windows
XP.
I see the following on Windows XP.
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\qc
\lang1037\f0\rtlch\fs20{\pict\wmetafile8\picwgoal5436\pichgoal3527
Please note that the "picw" and "pich" flags are missing. We recently
upgraded to richedit class "RICHEDIT50W". Earlier we were using
richedit class "RICHEDIT20W". And it was working correctly then.
However it is coming correctly on Windows 7 as below :
{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\qc
\lang1037\f0\rtlch\fs20{\pict
\wmetafile8\picw480\pich308\picwgoal5436\pichgoal3527
This can be reproduced as below:
1. Create window with class #define MSFTEDIT_CLASS L"RICHEDIT50W"
2. Insert a picture to this window/control with REOBJECT and
IRichEditOle-InsertObject or via clipboard
3. And (the most important)
EDITSTREAM es;
es.dwError = 0;
es.pfnCallback = (EDITSTREAMCALLBACK) FileStreamOut;
es.dwCookie = (DWORD)hFile;
4. SendMessage(richEditWnd, EM_STREAMOUT, (WPARAM) SF_RTF, &es);
and then under Windows XP SP3 stream doesn't include \pic[w|h] while
the same under Windows 7 sets those flags correctly.
Thank You,
Krishna Dave
Our application has a richedit control which has a wmf picture and
some text.
I read the text from rich edit control and save it as a .rtf file. RTF
file opens correctly but opening the RTF file in notepad shows
incorrect syntax of the external picture "control word" on Windows
XP.
I see the following on Windows XP.
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\qc
\lang1037\f0\rtlch\fs20{\pict\wmetafile8\picwgoal5436\pichgoal3527
Please note that the "picw" and "pich" flags are missing. We recently
upgraded to richedit class "RICHEDIT50W". Earlier we were using
richedit class "RICHEDIT20W". And it was working correctly then.
However it is coming correctly on Windows 7 as below :
{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\qc
\lang1037\f0\rtlch\fs20{\pict
\wmetafile8\picw480\pich308\picwgoal5436\pichgoal3527
This can be reproduced as below:
1. Create window with class #define MSFTEDIT_CLASS L"RICHEDIT50W"
2. Insert a picture to this window/control with REOBJECT and
IRichEditOle-InsertObject or via clipboard
3. And (the most important)
EDITSTREAM es;
es.dwError = 0;
es.pfnCallback = (EDITSTREAMCALLBACK) FileStreamOut;
es.dwCookie = (DWORD)hFile;
4. SendMessage(richEditWnd, EM_STREAMOUT, (WPARAM) SF_RTF, &es);
and then under Windows XP SP3 stream doesn't include \pic[w|h] while
the same under Windows 7 sets those flags correctly.
Thank You,
Krishna Dave