I see what you mean now. I missed the condition in the OnChar handler.
AliR.
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
No, because you only send the message if the character was lower case, and
it has been
converted to upper case, so there is no loop.
Had Microsoft done the subclassing with anything approcahing an
intelligent design, you
would just call the superclass handler with the transformed character, but
of course they
went out of their way to do it wrong, based on erroneous premises, and we
are living with
the consequences of that bad decision. The solution below won't work,
because they
deliberably IGNORE your parameter and instead pick up the WPARAM and
LPARAM that were
stored away before the message was dispatched!!!! Yes, it is stupid, but
the only
progress I ever made was getting that disclaimer paragraph added to all
the MFC calls.
Makes you wonder about how much adult supervision goes on there. I see
local decisions
made for the wrong reasons by the wrong people to make the decision, and
we get stuck with
the consequences.
joe
On Wed, 07 Mar 2007 19:52:51 GMT, "AliR \(VC++ MVP\)" <AliR@online.nospam>
wrote:
Catch the OnChar handler and do a SendMessage(WM_CHAR) from the OnChar
handler? Isn't that going to cause an infinite loop?
If the answer was in OnChar then why wouldn't this work?
OnChar(UINT nChar,....)
{
nChar = toupper(nChar);
CRichEditCtrl::OnChar(nChar,....);
}
But unfortunately that is not going to work. RichEdit ctrls handle their
characters differently than Edit controls.
AliR.
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:692uu25at9pnhefd22an46ubqpnnujmeff@4ax.com...
subclass the control. Add an OnChar handler. If the character is
lower-case, convert it
to upper-case and do a SendMessage of WM_CHAR, and don't call the
superclass handler.
joe
On Wed, 7 Mar 2007 08:09:15 -0800, Nathan Smith
<NathanSmith@discussions.microsoft.com>
wrote:
So does anyone have any ideas how I can implement case processing on a
Rich
Edit control? It sounds like I need an OnChar handler, but not sure how
to
do that with a resource created control.
Thanks.
"AliR (VC++ MVP)" wrote:
Sorry I missed the Rich part. RichEdit controls don't have the upper
only
functionality built-in.
AliR.
"Nathan Smith" <NathanSmith@discussions.microsoft.com> wrote in
message
news:8D8AFC8E-581C-4B7C-B837-D927813E033E@microsoft.com...
I am doing this on an event basis so I will need to do it using
SetWindowLong. I noticed the ES_UPPERCASE constant is used in CEdit
controls
- will this also work with CRichEdit controls?
Thanks.
"AliR (VC++ MVP)" wrote:
Either create the control with the ES_UPPERCASE style or use
SetWindowLong
to set.
m_Edit.SetWindowLong(GWL_STYLE,m_Edit.GetWindowLong(GWL_STYLE)|ES_UPPERCASE);
AliR.
"Nathan Smith" <NathanSmith@discussions.microsoft.com> wrote in
message
news:DE60F1E9-E5EF-4172-A4A0-205F5EB3E0C4@microsoft.com...
I have a dialog box that contains a RichEdit control that I need
to
force
all
input characters to be uppercase. I tried using the following
call:
SendDlgItemMessage(ID_FIELDDB_TEXT_ET, EM_SETEDITSTYLE,
(WPARAM)SES_UPPERCASE, (LPARAM)TRUE);
but it doesn't seem to work.
Is this the correct way of setting this property, or am I missing
something?
Thanks.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm