Issue with richtedit and external picture control word syntax.

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
 
M

Mayayana

I'm afraid you're lost. This is an XP user group, not
a programming group. It looks like you're using C++,
or maybe C-hash? In that case you want a Windows
C++ or .Net programming group. For .Net try here:

microsoft.public.dotnet.general

For C++ search the groups for "win32" or "windows".

(The obvious question would be why you think you
"upgraded" to RICHEDIT v. 4 when it doesn't work.
RICHEDIT20 gives you a RichEdit window v. 3. If you
don't need special features from the later version then
you'd just be cutting down the number of supported
Windows versions by switching to v. 4, which is an
XP update.)

http://msdn.microsoft.com/en-us/library/windows/desktop/bb787873(v=vs.85).aspx

--------------------------------------

| 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top