entering Unicode characters

Hi everybody,

I have a MFC app with a dialog with a Rich Edit control. I need to enter 
Unicode characters. When I enter Alt+nnn, I get the corresponding Unicode 
character (for example Alt+937 gives the greek letter omega).

When I do the same with a normal edit field (not Rich Edit) I get another 
character (looks like french e) - probably it gets converted to ANSI.

I need to be able to enter Unicode characters in the standard edit fields 
using the Alt+nnn method. How can I achieve that? Can I enable it somehow or 
do I have to implement it?

I am using Windows 2000, VS 6.0.

thanks for any idea,

Vaclav


0
no1498 (362)
9/13/2005 8:19:15 PM
vc.mfc 33608 articles. 0 followers. Follow

14 Replies
1123 Views

Similar Articles

[PageSpeed] 32

Have you defined UNICODE and _UNICODE and every other UNICODE define?

-- 
- Mark Randall
http://zetech.swehli.com

"Those people that think they know everything are a great annoyance to those 
of us who do"
    Isaac Asimov
"Vaclav" <no@spam.please> wrote in message 
news:%23sEdoBKuFHA.1364@tk2msftngp13.phx.gbl...
> Hi everybody,
>
> I have a MFC app with a dialog with a Rich Edit control. I need to enter 
> Unicode characters. When I enter Alt+nnn, I get the corresponding Unicode 
> character (for example Alt+937 gives the greek letter omega).
>
> When I do the same with a normal edit field (not Rich Edit) I get another 
> character (looks like french e) - probably it gets converted to ANSI.
>
> I need to be able to enter Unicode characters in the standard edit fields 
> using the Alt+nnn method. How can I achieve that? Can I enable it somehow 
> or do I have to implement it?
>
> I am using Windows 2000, VS 6.0.
>
> thanks for any idea,
>
> Vaclav
>
> 


0
yr (150)
9/13/2005 8:25:06 PM
yes, I defined both UNICODE and _UNICODE.
It works for Rich Edit, does not work with standard edit fields.
Vaclav

"Mark Randall" <mark[__OKTHISISFAKE_]yr@REMOVETHISgoogle.ANDTHIScom> p�e v 
diskusn�m p��sp�vku news:O3SW9EKuFHA.3188@TK2MSFTNGP14.phx.gbl...
> Have you defined UNICODE and _UNICODE and every other UNICODE define?
>
> -- 
> - Mark Randall
> http://zetech.swehli.com
>
> "Those people that think they know everything are a great annoyance to 
> those of us who do"
>    Isaac Asimov
> "Vaclav" <no@spam.please> wrote in message 
> news:%23sEdoBKuFHA.1364@tk2msftngp13.phx.gbl...
>> Hi everybody,
>>
>> I have a MFC app with a dialog with a Rich Edit control. I need to enter 
>> Unicode characters. When I enter Alt+nnn, I get the corresponding Unicode 
>> character (for example Alt+937 gives the greek letter omega).
>>
>> When I do the same with a normal edit field (not Rich Edit) I get another 
>> character (looks like french e) - probably it gets converted to ANSI.
>>
>> I need to be able to enter Unicode characters in the standard edit fields 
>> using the Alt+nnn method. How can I achieve that? Can I enable it somehow 
>> or do I have to implement it?
>>
>> I am using Windows 2000, VS 6.0.
>>
>> thanks for any idea,
>>
>> Vaclav
>>
>>
>
> 


0
no1498 (362)
9/13/2005 8:32:27 PM
....and I set a Unicode font to the edit field. i can enter unicode 
characters via clipboard. The only thing that does not work is Alt+nnn.
Vaclav

"Mark Randall" <mark[__OKTHISISFAKE_]yr@REMOVETHISgoogle.ANDTHIScom> p�e v 
diskusn�m p��sp�vku news:O3SW9EKuFHA.3188@TK2MSFTNGP14.phx.gbl...
> Have you defined UNICODE and _UNICODE and every other UNICODE define?
>
> -- 
> - Mark Randall
> http://zetech.swehli.com
>
> "Those people that think they know everything are a great annoyance to 
> those of us who do"
>    Isaac Asimov
> "Vaclav" <no@spam.please> wrote in message 
> news:%23sEdoBKuFHA.1364@tk2msftngp13.phx.gbl...
>> Hi everybody,
>>
>> I have a MFC app with a dialog with a Rich Edit control. I need to enter 
>> Unicode characters. When I enter Alt+nnn, I get the corresponding Unicode 
>> character (for example Alt+937 gives the greek letter omega).
>>
>> When I do the same with a normal edit field (not Rich Edit) I get another 
>> character (looks like french e) - probably it gets converted to ANSI.
>>
>> I need to be able to enter Unicode characters in the standard edit fields 
>> using the Alt+nnn method. How can I achieve that? Can I enable it somehow 
>> or do I have to implement it?
>>
>> I am using Windows 2000, VS 6.0.
>>
>> thanks for any idea,
>>
>> Vaclav
>>
>>
>
> 


0
no1498 (362)
9/13/2005 8:34:31 PM
There is a possibility that an ordinary edit control can't accept Unicode using the
Alt+nnn style.   I just tried this in a Unicode app which also has straight edit controls
and I can't get it to work correctly.  This is interesting, because it says that I have to
change all my edit controls to be rich-edit controls.  I noted that I was getting
characters beyond the 8-bit ANSI range (for example, 567 produced one of the "line
drawing" symbols from the OEM font) but I could not get any recognizable characters in by
using Character Map values.  I am going to have to look more carefully at this program; I
already set the MS Unicode font into the edit control.  It may be you have uncovered a bug
in the edit control, in which case it suggests that replacing the ordinary edit controls
with rich edit controls would be useful.
				joe

On Tue, 13 Sep 2005 22:34:31 +0200, "Vaclav" <no@spam.please> wrote:

>...and I set a Unicode font to the edit field. i can enter unicode 
>characters via clipboard. The only thing that does not work is Alt+nnn.
>Vaclav
>
>"Mark Randall" <mark[__OKTHISISFAKE_]yr@REMOVETHISgoogle.ANDTHIScom> p�e v 
>diskusn�m p��sp�vku news:O3SW9EKuFHA.3188@TK2MSFTNGP14.phx.gbl...
>> Have you defined UNICODE and _UNICODE and every other UNICODE define?
>>
>> -- 
>> - Mark Randall
>> http://zetech.swehli.com
>>
>> "Those people that think they know everything are a great annoyance to 
>> those of us who do"
>>    Isaac Asimov
>> "Vaclav" <no@spam.please> wrote in message 
>> news:%23sEdoBKuFHA.1364@tk2msftngp13.phx.gbl...
>>> Hi everybody,
>>>
>>> I have a MFC app with a dialog with a Rich Edit control. I need to enter 
>>> Unicode characters. When I enter Alt+nnn, I get the corresponding Unicode 
>>> character (for example Alt+937 gives the greek letter omega).
>>>
>>> When I do the same with a normal edit field (not Rich Edit) I get another 
>>> character (looks like french e) - probably it gets converted to ANSI.
>>>
>>> I need to be able to enter Unicode characters in the standard edit fields 
>>> using the Alt+nnn method. How can I achieve that? Can I enable it somehow 
>>> or do I have to implement it?
>>>
>>> I am using Windows 2000, VS 6.0.
>>>
>>> thanks for any idea,
>>>
>>> Vaclav
>>>
>>>
>>
>> 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
9/14/2005 3:14:23 PM
Thank you,

The problem with converting a standard edit control to a rich edit control 
is that it allows rich formatting (the user may copy and paste from another 
application). I need Unicode characters, but no formatting. Is it possible 
to switch a rich edit control to a plaintext mode?

Another option would be to process keypressed events in a standard edit 
control and implement the Alt+nnn feature, but i do not have much experience 
with that.

Vaclav



"Joseph M. Newcomer" <newcomer@flounder.com> p�se v diskusn�m pr�spevku 
news:cvegi15lu90io9pmobo2mtprgfhcu10i47@4ax.com...
> There is a possibility that an ordinary edit control can't accept Unicode 
> using the
> Alt+nnn style.   I just tried this in a Unicode app which also has 
> straight edit controls
> and I can't get it to work correctly.  This is interesting, because it 
> says that I have to
> change all my edit controls to be rich-edit controls.  I noted that I was 
> getting
> characters beyond the 8-bit ANSI range (for example, 567 produced one of 
> the "line
> drawing" symbols from the OEM font) but I could not get any recognizable 
> characters in by
> using Character Map values.  I am going to have to look more carefully at 
> this program; I
> already set the MS Unicode font into the edit control.  It may be you have 
> uncovered a bug
> in the edit control, in which case it suggests that replacing the ordinary 
> edit controls
> with rich edit controls would be useful.
> joe
>
> On Tue, 13 Sep 2005 22:34:31 +0200, "Vaclav" <no@spam.please> wrote:
>
>>...and I set a Unicode font to the edit field. i can enter unicode
>>characters via clipboard. The only thing that does not work is Alt+nnn.
>>Vaclav
>>
>>"Mark Randall" <mark[__OKTHISISFAKE_]yr@REMOVETHISgoogle.ANDTHIScom> p�e 
>>v
>>diskusn�m p��sp�vku news:O3SW9EKuFHA.3188@TK2MSFTNGP14.phx.gbl...
>>> Have you defined UNICODE and _UNICODE and every other UNICODE define?
>>>
>>> -- 
>>> - Mark Randall
>>> http://zetech.swehli.com
>>>
>>> "Those people that think they know everything are a great annoyance to
>>> those of us who do"
>>>    Isaac Asimov
>>> "Vaclav" <no@spam.please> wrote in message
>>> news:%23sEdoBKuFHA.1364@tk2msftngp13.phx.gbl...
>>>> Hi everybody,
>>>>
>>>> I have a MFC app with a dialog with a Rich Edit control. I need to 
>>>> enter
>>>> Unicode characters. When I enter Alt+nnn, I get the corresponding 
>>>> Unicode
>>>> character (for example Alt+937 gives the greek letter omega).
>>>>
>>>> When I do the same with a normal edit field (not Rich Edit) I get 
>>>> another
>>>> character (looks like french e) - probably it gets converted to ANSI.
>>>>
>>>> I need to be able to enter Unicode characters in the standard edit 
>>>> fields
>>>> using the Alt+nnn method. How can I achieve that? Can I enable it 
>>>> somehow
>>>> or do I have to implement it?
>>>>
>>>> I am using Windows 2000, VS 6.0.
>>>>
>>>> thanks for any idea,
>>>>
>>>> Vaclav
>>>>
>>>>
>>>
>>>
>>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm 


0
no1498 (362)
9/17/2005 7:49:28 AM
I think the Alt+nnn approach happens at a level below the messaging system, but I haven't
looked at this in any detail.

It might be easier to intercept Ctrl+V and do your own plaintext paste, thus overriding
the built-in behavior of the rich edit control. I'd need to experiment a bit here...
				joe

On Sat, 17 Sep 2005 09:49:28 +0200, "Vaclav" <no@spam.please> wrote:

>Thank you,
>
>The problem with converting a standard edit control to a rich edit control 
>is that it allows rich formatting (the user may copy and paste from another 
>application). I need Unicode characters, but no formatting. Is it possible 
>to switch a rich edit control to a plaintext mode?
>
>Another option would be to process keypressed events in a standard edit 
>control and implement the Alt+nnn feature, but i do not have much experience 
>with that.
>
>Vaclav
>
>
>
>"Joseph M. Newcomer" <newcomer@flounder.com> p�se v diskusn�m pr�spevku 
>news:cvegi15lu90io9pmobo2mtprgfhcu10i47@4ax.com...
>> There is a possibility that an ordinary edit control can't accept Unicode 
>> using the
>> Alt+nnn style.   I just tried this in a Unicode app which also has 
>> straight edit controls
>> and I can't get it to work correctly.  This is interesting, because it 
>> says that I have to
>> change all my edit controls to be rich-edit controls.  I noted that I was 
>> getting
>> characters beyond the 8-bit ANSI range (for example, 567 produced one of 
>> the "line
>> drawing" symbols from the OEM font) but I could not get any recognizable 
>> characters in by
>> using Character Map values.  I am going to have to look more carefully at 
>> this program; I
>> already set the MS Unicode font into the edit control.  It may be you have 
>> uncovered a bug
>> in the edit control, in which case it suggests that replacing the ordinary 
>> edit controls
>> with rich edit controls would be useful.
>> joe
>>
>> On Tue, 13 Sep 2005 22:34:31 +0200, "Vaclav" <no@spam.please> wrote:
>>
>>>...and I set a Unicode font to the edit field. i can enter unicode
>>>characters via clipboard. The only thing that does not work is Alt+nnn.
>>>Vaclav
>>>
>>>"Mark Randall" <mark[__OKTHISISFAKE_]yr@REMOVETHISgoogle.ANDTHIScom> p�e 
>>>v
>>>diskusn�m p��sp�vku news:O3SW9EKuFHA.3188@TK2MSFTNGP14.phx.gbl...
>>>> Have you defined UNICODE and _UNICODE and every other UNICODE define?
>>>>
>>>> -- 
>>>> - Mark Randall
>>>> http://zetech.swehli.com
>>>>
>>>> "Those people that think they know everything are a great annoyance to
>>>> those of us who do"
>>>>    Isaac Asimov
>>>> "Vaclav" <no@spam.please> wrote in message
>>>> news:%23sEdoBKuFHA.1364@tk2msftngp13.phx.gbl...
>>>>> Hi everybody,
>>>>>
>>>>> I have a MFC app with a dialog with a Rich Edit control. I need to 
>>>>> enter
>>>>> Unicode characters. When I enter Alt+nnn, I get the corresponding 
>>>>> Unicode
>>>>> character (for example Alt+937 gives the greek letter omega).
>>>>>
>>>>> When I do the same with a normal edit field (not Rich Edit) I get 
>>>>> another
>>>>> character (looks like french e) - probably it gets converted to ANSI.
>>>>>
>>>>> I need to be able to enter Unicode characters in the standard edit 
>>>>> fields
>>>>> using the Alt+nnn method. How can I achieve that? Can I enable it 
>>>>> somehow
>>>>> or do I have to implement it?
>>>>>
>>>>> I am using Windows 2000, VS 6.0.
>>>>>
>>>>> thanks for any idea,
>>>>>
>>>>> Vaclav
>>>>>
>>>>>
>>>>
>>>>
>>>
>> 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
0
newcomer (15975)
9/17/2005 5:41:05 PM
I have to leave in a few minutes, and may not get a chance to work on this for several
more days, but here's what I've found thus far:

I selected Arial Unicode MS into a regular and rich edit control.  I tried Alt+456 and got
different results in both; the Rich Edit control displayed the correct value.  I then put
Spy++ on it, and it appears that, as usualy with Spy++, it is seriously-brain-dead.
Alt+456 claims to return the character '+'.  What I get is a WM_SYSKEYDOWN for the VK_MENU
(Alt) key, followed by WM_SYSKEYDOWNs for VK_LEFT (numeric 4), VK_CLEAR (numeric 5) and
VK_RIGHT (numeric 6), floowed by VK_KEYUP for the VK_MENU (alt) key, followed by Spy++
tellilng me that it saw a WM_CHAR with character code '+' (43) which is clearly erroneous.
It's like Spy++ was never tested on a Unicode app! What I get is a symbol Lj, which is
code page 01 C8, or the LATIN CAPITAL LETTER L WITH SMALL LETTER J (according to the
Unicode standard).  I don't have time right now to run the tests.  This should be reported
as a bug to Microsoft, that the normal edit control, even in Unicode mode, erroneously
interprets Unicode characters.
					joe

On Sat, 17 Sep 2005 09:49:28 +0200, "Vaclav" <no@spam.please> wrote:

>Thank you,
>
>The problem with converting a standard edit control to a rich edit control 
>is that it allows rich formatting (the user may copy and paste from another 
>application). I need Unicode characters, but no formatting. Is it possible 
>to switch a rich edit control to a plaintext mode?
>
>Another option would be to process keypressed events in a standard edit 
>control and implement the Alt+nnn feature, but i do not have much experience 
>with that.
>
>Vaclav
>
>
>
>"Joseph M. Newcomer" <newcomer@flounder.com> p�se v diskusn�m pr�spevku 
>news:cvegi15lu90io9pmobo2mtprgfhcu10i47@4ax.com...
>> There is a possibility that an ordinary edit control can't accept Unicode 
>> using the
>> Alt+nnn style.   I just tried this in a Unicode app which also has 
>> straight edit controls
>> and I can't get it to work correctly.  This is interesting, because it 
>> says that I have to
>> change all my edit controls to be rich-edit controls.  I noted that I was 
>> getting
>> characters beyond the 8-bit ANSI range (for example, 567 produced one of 
>> the "line
>> drawing" symbols from the OEM font) but I could not get any recognizable 
>> characters in by
>> using Character Map values.  I am going to have to look more carefully at 
>> this program; I
>> already set the MS Unicode font into the edit control.  It may be you have 
>> uncovered a bug
>> in the edit control, in which case it suggests that replacing the ordinary 
>> edit controls
>> with rich edit controls would be useful.
>> joe
>>
>> On Tue, 13 Sep 2005 22:34:31 +0200, "Vaclav" <no@spam.please> wrote:
>>
>>>...and I set a Unicode font to the edit field. i can enter unicode
>>>characters via clipboard. The only thing that does not work is Alt+nnn.
>>>Vaclav
>>>
>>>"Mark Randall" <mark[__OKTHISISFAKE_]yr@REMOVETHISgoogle.ANDTHIScom> p�e 
>>>v
>>>diskusn�m p��sp�vku news:O3SW9EKuFHA.3188@TK2MSFTNGP14.phx.gbl...
>>>> Have you defined UNICODE and _UNICODE and every other UNICODE define?
>>>>
>>>> -- 
>>>> - Mark Randall
>>>> http://zetech.swehli.com
>>>>
>>>> "Those people that think they know everything are a great annoyance to
>>>> those of us who do"
>>>>    Isaac Asimov
>>>> "Vaclav" <no@spam.please> wrote in message
>>>> news:%23sEdoBKuFHA.1364@tk2msftngp13.phx.gbl...
>>>>> Hi everybody,
>>>>>
>>>>> I have a MFC app with a dialog with a Rich Edit control. I need to 
>>>>> enter
>>>>> Unicode characters. When I enter Alt+nnn, I get the corresponding 
>>>>> Unicode
>>>>> character (for example Alt+937 gives the greek letter omega).
>>>>>
>>>>> When I do the same with a normal edit field (not Rich Edit) I get 
>>>>> another
>>>>> character (looks like french e) - probably it gets converted to ANSI.
>>>>>
>>>>> I need to be able to enter Unicode characters in the standard edit 
>>>>> fields
>>>>> using the Alt+nnn method. How can I achieve that? Can I enable it 
>>>>> somehow
>>>>> or do I have to implement it?
>>>>>
>>>>> I am using Windows 2000, VS 6.0.
>>>>>
>>>>> thanks for any idea,
>>>>>
>>>>> Vaclav
>>>>>
>>>>>
>>>>
>>>>
>>>
>> 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
0
newcomer (15975)
9/17/2005 6:11:21 PM
Solved it, I think.  Here's an example from my subclass which is a simple subclass of
RichEditCtrl.  This only handles Ctrl+V as "Paste"; I did not generalize to handling
WM_PASTE messages or the other keyboard shortcuts; that's an Exercise For The Reader.

void CTextOnlyRichEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
   {
    if(nChar == _T('V'))
       { /* paste */
        if(IsClipboardFormatAvailable(CF_UNICODETEXT))
           { /* Unicode */
            if(!OpenClipboard())
               return;
            HANDLE h = GetClipboardData(CF_UNICODETEXT);
            LPWSTR p = (LPWSTR)GlobalLock(h);
            SETTEXTEX stex;
            stex.flags = ST_SELECTION | ST_KEEPUNDO;
            stex.codepage = 1200;  // Unicode code page(set SETTEXTEX documentation)
            SendMessage(EM_SETTEXTEX, (WPARAM)&stex, (LPARAM)p);
            GlobalUnlock(h);
            CloseClipboard();
           } /* Unicode */
        return;
       } /* paste */
        
    CRichEditCtrl::OnKeyDown(nChar, nRepCnt, nFlags);
   }

I copied formatted rich edit material into the clipboard and this paste pastes the
unformatted text into it.

I needed to change the rich edit control to RichEdit20W explicitly in the resource file
(I'm using VS6 for this), I had to add the following rich2.h/rich2.cpp

// start of rich2.h
#if _MFC_VER < 0x0700
BOOL PASCAL AfxInitRichEdit2();
#endif // _MFC_VER < 0x0700
// end of rich2.h
// start of rich2.cpp
#include "stdafx.h"

#if _MFC_VER < 0x0700
#include <afximpl.h>

BOOL PASCAL AfxInitRichEdit2()
   {
    _AFX_RICHEDIT_STATE* pState = _afxRichEditState;
    ASSERT(pState->m_hInstRichEdit == NULL);
    if (pState->m_hInstRichEdit == NULL)
       pState->m_hInstRichEdit = LoadLibraryA("RICHED20.DLL");
    return pState->m_hInstRichEdit != NULL;
   }
#endif // _MFC_VER < 0x0700
// end of rich2.cpp

 and put the MFC\src directory, where afximpl.h is stored, in the include path.

If you don't mind waiting until Wednesday, I can send you the whole little project I did.
However, I will be leaving early Sunday morning for several days.  Send me private email
if you want the complete working test project.  I'll send it when I get back.
			joe


On Sat, 17 Sep 2005 09:49:28 +0200, "Vaclav" <no@spam.please> wrote:

>Thank you,
>
>The problem with converting a standard edit control to a rich edit control 
>is that it allows rich formatting (the user may copy and paste from another 
>application). I need Unicode characters, but no formatting. Is it possible 
>to switch a rich edit control to a plaintext mode?
>
>Another option would be to process keypressed events in a standard edit 
>control and implement the Alt+nnn feature, but i do not have much experience 
>with that.
>
>Vaclav
>
>
>
>"Joseph M. Newcomer" <newcomer@flounder.com> p�se v diskusn�m pr�spevku 
>news:cvegi15lu90io9pmobo2mtprgfhcu10i47@4ax.com...
>> There is a possibility that an ordinary edit control can't accept Unicode 
>> using the
>> Alt+nnn style.   I just tried this in a Unicode app which also has 
>> straight edit controls
>> and I can't get it to work correctly.  This is interesting, because it 
>> says that I have to
>> change all my edit controls to be rich-edit controls.  I noted that I was 
>> getting
>> characters beyond the 8-bit ANSI range (for example, 567 produced one of 
>> the "line
>> drawing" symbols from the OEM font) but I could not get any recognizable 
>> characters in by
>> using Character Map values.  I am going to have to look more carefully at 
>> this program; I
>> already set the MS Unicode font into the edit control.  It may be you have 
>> uncovered a bug
>> in the edit control, in which case it suggests that replacing the ordinary 
>> edit controls
>> with rich edit controls would be useful.
>> joe
>>
>> On Tue, 13 Sep 2005 22:34:31 +0200, "Vaclav" <no@spam.please> wrote:
>>
>>>...and I set a Unicode font to the edit field. i can enter unicode
>>>characters via clipboard. The only thing that does not work is Alt+nnn.
>>>Vaclav
>>>
>>>"Mark Randall" <mark[__OKTHISISFAKE_]yr@REMOVETHISgoogle.ANDTHIScom> p�e 
>>>v
>>>diskusn�m p��sp�vku news:O3SW9EKuFHA.3188@TK2MSFTNGP14.phx.gbl...
>>>> Have you defined UNICODE and _UNICODE and every other UNICODE define?
>>>>
>>>> -- 
>>>> - Mark Randall
>>>> http://zetech.swehli.com
>>>>
>>>> "Those people that think they know everything are a great annoyance to
>>>> those of us who do"
>>>>    Isaac Asimov
>>>> "Vaclav" <no@spam.please> wrote in message
>>>> news:%23sEdoBKuFHA.1364@tk2msftngp13.phx.gbl...
>>>>> Hi everybody,
>>>>>
>>>>> I have a MFC app with a dialog with a Rich Edit control. I need to 
>>>>> enter
>>>>> Unicode characters. When I enter Alt+nnn, I get the corresponding 
>>>>> Unicode
>>>>> character (for example Alt+937 gives the greek letter omega).
>>>>>
>>>>> When I do the same with a normal edit field (not Rich Edit) I get 
>>>>> another
>>>>> character (looks like french e) - probably it gets converted to ANSI.
>>>>>
>>>>> I need to be able to enter Unicode characters in the standard edit 
>>>>> fields
>>>>> using the Alt+nnn method. How can I achieve that? Can I enable it 
>>>>> somehow
>>>>> or do I have to implement it?
>>>>>
>>>>> I am using Windows 2000, VS 6.0.
>>>>>
>>>>> thanks for any idea,
>>>>>
>>>>> Vaclav
>>>>>
>>>>>
>>>>
>>>>
>>>
>> 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
0
newcomer (15975)
9/18/2005 5:54:49 AM
This is what happens when I rush trying to get something done in a hurry...

The code responds to any "V" key (shift-V, plain-V, Ctrl+V), you should include the test

 && GetKeyState(VK_CONTROL) < 0

as part of the test of the 'V'.

Although I didn't mention it, CF_TEXT will be retrievable as CF_UNICODETEXT (see the
GetClipboardData discussion about implicit coercions)
				joe

On Sat, 17 Sep 2005 09:49:28 +0200, "Vaclav" <no@spam.please> wrote:

>Thank you,
>
>The problem with converting a standard edit control to a rich edit control 
>is that it allows rich formatting (the user may copy and paste from another 
>application). I need Unicode characters, but no formatting. Is it possible 
>to switch a rich edit control to a plaintext mode?
>
>Another option would be to process keypressed events in a standard edit 
>control and implement the Alt+nnn feature, but i do not have much experience 
>with that.
>
>Vaclav
>
>
>
>"Joseph M. Newcomer" <newcomer@flounder.com> p�se v diskusn�m pr�spevku 
>news:cvegi15lu90io9pmobo2mtprgfhcu10i47@4ax.com...
>> There is a possibility that an ordinary edit control can't accept Unicode 
>> using the
>> Alt+nnn style.   I just tried this in a Unicode app which also has 
>> straight edit controls
>> and I can't get it to work correctly.  This is interesting, because it 
>> says that I have to
>> change all my edit controls to be rich-edit controls.  I noted that I was 
>> getting
>> characters beyond the 8-bit ANSI range (for example, 567 produced one of 
>> the "line
>> drawing" symbols from the OEM font) but I could not get any recognizable 
>> characters in by
>> using Character Map values.  I am going to have to look more carefully at 
>> this program; I
>> already set the MS Unicode font into the edit control.  It may be you have 
>> uncovered a bug
>> in the edit control, in which case it suggests that replacing the ordinary 
>> edit controls
>> with rich edit controls would be useful.
>> joe
>>
>> On Tue, 13 Sep 2005 22:34:31 +0200, "Vaclav" <no@spam.please> wrote:
>>
>>>...and I set a Unicode font to the edit field. i can enter unicode
>>>characters via clipboard. The only thing that does not work is Alt+nnn.
>>>Vaclav
>>>
>>>"Mark Randall" <mark[__OKTHISISFAKE_]yr@REMOVETHISgoogle.ANDTHIScom> p�e 
>>>v
>>>diskusn�m p��sp�vku news:O3SW9EKuFHA.3188@TK2MSFTNGP14.phx.gbl...
>>>> Have you defined UNICODE and _UNICODE and every other UNICODE define?
>>>>
>>>> -- 
>>>> - Mark Randall
>>>> http://zetech.swehli.com
>>>>
>>>> "Those people that think they know everything are a great annoyance to
>>>> those of us who do"
>>>>    Isaac Asimov
>>>> "Vaclav" <no@spam.please> wrote in message
>>>> news:%23sEdoBKuFHA.1364@tk2msftngp13.phx.gbl...
>>>>> Hi everybody,
>>>>>
>>>>> I have a MFC app with a dialog with a Rich Edit control. I need to 
>>>>> enter
>>>>> Unicode characters. When I enter Alt+nnn, I get the corresponding 
>>>>> Unicode
>>>>> character (for example Alt+937 gives the greek letter omega).
>>>>>
>>>>> When I do the same with a normal edit field (not Rich Edit) I get 
>>>>> another
>>>>> character (looks like french e) - probably it gets converted to ANSI.
>>>>>
>>>>> I need to be able to enter Unicode characters in the standard edit 
>>>>> fields
>>>>> using the Alt+nnn method. How can I achieve that? Can I enable it 
>>>>> somehow
>>>>> or do I have to implement it?
>>>>>
>>>>> I am using Windows 2000, VS 6.0.
>>>>>
>>>>> thanks for any idea,
>>>>>
>>>>> Vaclav
>>>>>
>>>>>
>>>>
>>>>
>>>
>> 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
0
newcomer (15975)
9/18/2005 12:46:37 PM
> The problem with converting a standard edit control to a rich edit control 
> is that it allows rich formatting (the user may copy and paste from another 
> application). I need Unicode characters, but no formatting. Is it possible 
> to switch a rich edit control to a plaintext mode?

Try sending EM_SETTEXTMODE with TM_PLAINTEXT.
I hope this will not disable the Alt-nnn functionality (I did not try :-)


-- 
Mihai Nita [Microsoft MVP, Windows - SDK]
------------------------------------------
Replace _year_ with _ to get the real email
0
9/19/2005 4:38:25 AM
Works fine.
Thanks a lot!

Vaclav

"Mihai N." <nmihai_year_2000@yahoo.com> p�e v diskusn�m p��sp�vku 
news:Xns96D5DC221A3F2MihaiN@207.46.248.16...
>> The problem with converting a standard edit control to a rich edit 
>> control
>> is that it allows rich formatting (the user may copy and paste from 
>> another
>> application). I need Unicode characters, but no formatting. Is it 
>> possible
>> to switch a rich edit control to a plaintext mode?
>
> Try sending EM_SETTEXTMODE with TM_PLAINTEXT.
> I hope this will not disable the Alt-nnn functionality (I did not try :-)
>
>
> -- 
> Mihai Nita [Microsoft MVP, Windows - SDK]
> ------------------------------------------
> Replace _year_ with _ to get the real email 


0
no1498 (362)
9/19/2005 7:53:16 PM
Clearly I have been warped by too much time spent in RichEdit 1.0.  I missed that one
completely!
				joe

On Sun, 18 Sep 2005 21:38:25 -0700, "Mihai N." <nmihai_year_2000@yahoo.com> wrote:

>> The problem with converting a standard edit control to a rich edit control 
>> is that it allows rich formatting (the user may copy and paste from another 
>> application). I need Unicode characters, but no formatting. Is it possible 
>> to switch a rich edit control to a plaintext mode?
>
>Try sending EM_SETTEXTMODE with TM_PLAINTEXT.
>I hope this will not disable the Alt-nnn functionality (I did not try :-)
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
9/20/2005 5:41:08 PM
Thank you anyway for your help!
Vaclav

"Joseph M. Newcomer" <newcomer@flounder.com> p�se v diskusn�m pr�spevku 
news:sci0j1hc9rmbnfjs5ha7d7461rjhn10ain@4ax.com...
> Clearly I have been warped by too much time spent in RichEdit 1.0.  I 
> missed that one
> completely!
> joe
>
> On Sun, 18 Sep 2005 21:38:25 -0700, "Mihai N." 
> <nmihai_year_2000@yahoo.com> wrote:
>
>>> The problem with converting a standard edit control to a rich edit 
>>> control
>>> is that it allows rich formatting (the user may copy and paste from 
>>> another
>>> application). I need Unicode characters, but no formatting. Is it 
>>> possible
>>> to switch a rich edit control to a plaintext mode?
>>
>>Try sending EM_SETTEXTMODE with TM_PLAINTEXT.
>>I hope this will not disable the Alt-nnn functionality (I did not try :-)
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm 


0
no1498 (362)
9/21/2005 6:17:35 PM
> Clearly I have been warped by too much time spent in RichEdit 1.0.  I 
missed that one
> completely!
>                     joe
Sometimes a fresh eye from an outsider helps :-)

-- 
Mihai Nita [Microsoft MVP, Windows - SDK]
------------------------------------------
Replace _year_ with _ to get the real email
0
9/22/2005 6:44:19 AM
Reply:

Similar Artilces:

French character lost during convertion
I have a dbase III+ file. There are French characters in it. When I convert the dbase file to Excel 2003, the French characters are changed to wrong characters. For example "Th=E9r=E8se" became "ThTrFse". How can I avoid this? TIA Gordon. ...

Count the number of characters created by string text
Is there a formula that will count the number of characters, and spaces between characters, in a short paragraph created by a string text? It is acceptible if spaces cannot be counted. Thanks. Michael Answered in another group you posted to. In article <1169220981.833905.146790@m58g2000cwm.googlegroups.com>, mrlanier@hotmail.com wrote: > Is there a formula that will count the number of characters, and spaces > between characters, in a short paragraph created by a string text? It > is acceptible if spaces cannot be counted. Thanks. > > Michael Thanks. Michael ...

List of XPath Escape Characters
In my previous post, I asked about a routine which prepares a string for an XPath query by taking care of escape characters. Unable to find a list, I'm now wondering assumign I enclose the attribute value in quotes in my XPath query, what other escape characters need to be handled aside from a quotation mark? As I understand it, an apostrophe wouldn't be a problem since I'm enclosing the string in quotes. thanks! Hi Matthew, For a list of these special characters, you may refer to: HOW TO: Locate and Replace Special Characters in an XML File with Visual Basic .NET http:/...

How to simulate pressing the enter key
Hello, everybody, in my current application there is a message box popping up every 5 minutes. This happens because I use a dll, not written by my own. I want my application to automatically close this message box by pressing the enter key. I tried it with the FindWindow()-function in combination with SendMessage(). But unfortunately I get a pointer to the window but it doesn't get closed. So I wonder if I do anything wrong?!? Here is a snippet of my code: LRESULT res; CWnd* pWnd = CWnd::FindWindow(NULL,_T("nameOfMessageBox")); if (pWnd) res = pWnd->SendMessage(WM_KEYD...

Enter a formula to return a result from a cell
Hi Guys, I am using Excel 2000. Fairly new to excel formulas. I have done some basics and mostly learned on my own and have had help from this group from time to time. I have a table with predicted peak flow numbers for boys and girls. There are many rows and many columns but I'll just list 3 from each as an example. Rows are ages Columns are heights in inches. Row 8 is age 6 Row 9 is age 7 Row 10 is age 8 Column C is 44 Column D is 45 Column E is 46 We determine the predicted peak flow based on the age and height of the child. All of the predicted peak flows are entered. Co...

Viewing Control Characters
Hi, I want to view and edit control characters such as <tab> and <LF> in text files that I import into Excel 2007 on a Windows XP laptop. I'm not able to view or edit them even though I can verify their presence using LEN and CODE functions. It works on Excel 2007 on an XP desktop at work. The control characters show up as boxes or boxes around symbols. Is there a setup option on XP, Office, or Excel that I need to select? Thanks, Paul Try the Terminal font. For example: =CHAR(1) should display a smilelyface. -- Gary''s Student - gsnu201001 ...

Excel 2003 spreadsheet. I enter the any number and it is entered.
If I enter a number into a cell it is put in like a decimal. For example, if I enter 10 it is put in as .1 500 is entered as a 5 Thank you Mary Mary, Goto Tools>Options and on the Edit tab you should see The Fixed Decimal Places box checked. Uncheck it. -- HTH RP "maryu" <maryu@discussions.microsoft.com> wrote in message news:65C0E0FB-43F3-4F34-8A86-FBA3F02EC9B1@microsoft.com... > If I enter a number into a cell it is put in like a decimal. For example, if > I enter 10 it is put in as .1 500 is entered as a 5 > Thank you > Mary ...

office:mac, word, unicode fonts
Problems with Office:Mac v.X Word on Mac notebook running OSX10.3 This application does not seem to support some of the characters in a unicode font I want to use. Any suggestions about getting around it, or another word processing program that will let me use the full capability of the font I want? kate <anonymous@discussions.microsoft.com> wrote: > This application does not seem to support some of the characters in a > unicode font I want to use. Any suggestions about getting around it, or > another word processing program that will let me use the full capability >...

Formatting cells entered by a macro
I have a macro, that selects the last row in a range of cells and inputs a blank row just above this (as below). I want to then format the cells I input, and am having trouble writing the macro to select them Can anyone help? Dim LastRow As Long, NumberOfBlankRows NumberOfBlankRows = 1 LastRow = Range("A3:R1000").Find(What:="*", SearchOrder:=xlColumns, _ SearchDirection:=xlPrevious, LookIn:=xlValues).Row Intersect(Range("A:R"), Rows(LastRow)).Resize(NumberOfBlankRows).Insert You didn't tell us what kind of format you wan...

Money 99 Cannot enter PIN to open files
Each time I attempt to enter my 7 character PIN only the first 2 characters are accepted. When I type in the 3rd character the cursor jumps back between the first 2 characters. I have rebooted my computer several times, tried to open archived files, and nothing changes. Would appreciate any suggestions how to solve this problem. What is that 3rd character? (Does it happen to be a 4, and are you using the number pad and forgot to turn on the NumLock?). Or do you have some type of keyboard macro assigned to that character? -Mark <anonymous@discussions.microsoft.com> wrote in m...

try to enter normal number but get this instead 9.10115E+21
I'm trying to make a list of delivery confirmation numbers but when I put the number in it automatically changes it to 9.10015E+21. I also tried a different format but it just changed the numbers at the end to all 0000000. How can I just get it to show the whole number I type in? "flowers" <flowers@discussions.microsoft.com> wrote in message news:018F1097-9204-4F5F-B1F6-81CBB87C379A@microsoft.com... > I'm trying to make a list of delivery confirmation numbers but when I put > the > number in it automatically changes it to 9.10015E+21. I also tried a > ...

enter current time with seconds
Control-Alt-; enters the current time but it does not have a second information. Is there a setting that it will include the second information? Thanks, CTRL + SHIFT + ; enters the current time. No, seconds cannot be included. You need a small macro for that. Sub NOWTIME() ActiveCell.Value = Format(Now(), "h:mm:ss AM/PM") End Sub Gord Dibben MS Excel MVP On Wed, 13 Jan 2010 06:56:14 -0800 (PST), cpliu <spamfreeliu@yahoo.com> wrote: >Control-Alt-; enters the current time but it does not have a second >information. Is there a setting tha...

Is there a way to prevent Character to Number conversion
I use a web application that displays data in HTML tables in a we browser. I would like to save the HTML files locally, and open them i Excel. Excel takes all of the fields which contain numbers, and coverts the to numeric fields, even if they are intended to be character fields. This causes a problem for me - in that Excel will trim leading zero (from labeler codes, and UPC's) - which I *don't* want to happen. Is there an option or setting that I could use in Excel that woul prevent it from doing this conversion when I open these HTML files? Thanks in advance -- Message posted f...

How to serch for Alt + Enter
Hi, I got a document where hundreds of cells are filled with lots of text. Whoever worked on it used the Alt + Enter function to create a new line (instead of wraping the text). Is there a way to search for Alt + Enter and replace it with a space? Thanks. Kikilein In the find what box hold down alt key while typing 010 on the numpad, release the alt button, put a space in the replace with box and select replace all -- Regards, Peo Sjoblom (No private emails please, for everyone's benefit keep the discussion in the newsgroup/forum) "kikilein" <anonymous@discu...

Query/ report- print report each wednesday with the data entered from the previously week
Hello all, My boss asked me to print a report each wednesday, my next print will be the 16 of May with data that I previously entered between 7 to 11 of May. If there a way to create a query and then create a report which I can print each wednesday with the data entered from the previously week? Your help will be much appreciated!! Thanking you all in advance, Fred's On 10 May 2007 07:54:32 -0700, Fred's <frederic10_mess@hotmail.com> wrote: > >Hello all, > >My boss asked me to print a report each wednesday, my next print will >be the 16 of May with data th...

Form just opened doesn't see data entered in previous form
I have one form displaying data from an organizations table (name and address of organizations) with a subform displaying data from a contacts table (name, address, organization phone, etc.). The second form displays data from the contacts table with a subform displaying data from the organizations table. When I enter an organization in the first form and a contact in the subform of this first form then open the second form (with a button on this form), the data entered in the first form is not available. The data is present in the underlying tables but a search in the organizations ...

special characters in a visio drawing
How do I enter special characters in a drawing (infinity symbol) On Fri, 8 Jun 2007 06:19:04 -0700, Lincoln B <LincolnB@discussions.microsoft.com> wrote: >How do I enter special characters in a drawing (infinity symbol) a. Use Character Map from Start -> Accessories -> System b. (only while in text entry mode): menu Insert -> Symbol c. Various 3rd party programs -- Regards, Paul Herber, Sandrila Ltd. http://www.pherber.com/ Unicode characters http://www.diacrit.sandrila.co.uk/ Email address in headers is invalid. "Lincoln B" wrote: &...

restrict value entered into cell
Hi, Is there a way to restrict user to enter negative values into a cell? TIA eric :( Hi Eric One way: Select the range (e.g E34:E56) Data > Datavalidation > Custom enter this formula =E34>0 -- Best Regards Leo Heuser MVP Excel Followup to newsgroup only please. "ericlye" <ericlye.st9ay@excelforum.com> skrev i en meddelelse news:ericlye.st9ay@excelforum.com... > Hi, > > Is there a way to restrict user to enter negative values into a cell? > > TIA > eric > > :( ...

Find out if a Unicode character is a letter?
Hi guys! Does anybody know if there's a way in c++ (STL or MFC) to find out if a Unicode character is categorized as a letter? I need something that is pretty much like Char.IsLetter() from .NET. I've seen the MSDN about it, and it seems to find characters under categories "Lu, Ll, Lt, Lm, Lo". Is that something that I can check or is it some .NET built-it definition of Unicode? Thanks! "Dani" <anonymous@discussions.microsoft.com> wrote in message news:uGEUCsE0HHA.3400@TK2MSFTNGP03.phx.gbl... > Hi guys! > Does anybody know if there's a way ...

How to count character and space?
How do I create a macro or script to calculate how characters and space in each cell? I import many worksheet to my other program but only import maxinum of total 30 characters and space per cell. I hate to have manually count each cell. Thanks Rocky Do you really need a macro? You could use =LEN(A1) to get the length of the text in cell A1. In article <O9kSqZU9EHA.2600@TK2MSFTNGP09.phx.gbl>, "Rocky Lam" <RockylamATyahooDOTcom> wrote: > How do I create a macro or script to calculate how characters and space in > each cell? I import many workshe...

size of a file and unicode
Hi! I have this simple program and write 16 character into the file called test.txt. If I check the size of the file by using the Length propery on the FileInfo class I can see that myLong variable is 16. If I use a binary Viewer to look at the file test.txt I see that the number of bytes is 16 with the following Hex values 31 32 33 34 35 36 37 38 39 31 32 33 34 35 36 37 Now to my question but unicode is two bytes. I have thought that unicode is used but here it's not used because each charcter is just a single byte and not 2 bytes that unicode is ? static void Main(str...

Entering + or
Hopefully there is a simple answer to this. I have cells formatted as general, though I have tried it text too, and would like to enter in a + or -. Everytime I do it, it assumes I'm entering in a function and changes it to +D2 (id I'm in the d2 cell.) How can I put in a + or - without this problem? Thanks for the help. Also, this in Excel 2000 and Excel XP. But, I think the - problem doesn't occur in XP. BR Bubba I suspect under tools>options>transition you have 'transition formula entry checked'. The default behaviour should be that a leading minus is sh...

Enter behaviour on textbox
Hi, I have a multiview view with a panel on it and in that panel a table with several controls (2 dropdown,3 textbox, 2 button, 1 gridview). When data is entered in one textbox and button1 is pressed, it puts the data in a gridview. Since the data in the textbox is a number I want it to respond to the Enter key. Hitting the enter key should do the same as the button. I have tried it by putting the panels defaultbutton on that button but while the page does a refresh, it does not go to the button click event. I have given the textbox an argument for the onkeydown event, b...

Remove single text characters
REMOVE SINGLE TEXT CHARACTERS IN A CELL (JOHN C AND LINDA Q) Here one way, but probably not the quickest: 1. With your values in column A, put this in B1 and copy down: =" "&A1&" " 2. Now copy column B, select col. A, and go to Edit > Paste Special > Value. 3. Press ESC and then press Ctrl+H. 4. In the "Find What" box put <space>?<space> and "Replace With" <space>. Don't actual key in th word <space>, just hit your spacebar. Select "Replace All" 5. Now repace the formula from step 1 with =TRI...

Font displays as squares rather than as characters...
I can use Estrangelo Edessa in Word but not in Excel. Is there something I can do so that it works correctly in Excel? ...