|
-
September 28th, 2005, 05:49 PM
#1
Unicode and EM_GETLINE
I having trouble getting a Unicode character from a single line EDIT control. This code works for non-unicode and unicode if the character is one of the ASCII characters:
Code:
int length = SendMessage( hwnd, EM_LINELENGTH, 0, 0 );
if( length > 0 )
{
TCHAR* buffer = new TCHAR[length + 1];
buffer[length] = '\0';
buffer[0] = length;
SendMessage( hwnd, EM_GETLINE, 0, (LPARAM)buffer );
}
However, if I past Japanese characters into the edit box, then try to get the line, all I get are question marks (although the correct characters are shown). Does anyone know how to fix this? I would prefer to stick with the edit control if possible, and not use a rich-edit.
Thanks!
Kelly
-
September 28th, 2005, 05:57 PM
#2
Re: Unicode and EM_GETLINE
Oops...nevermind...I was compiling with MBCS instead of Unicode.
Kelly
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|