Runt888
September 28th, 2005, 05:49 PM
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:
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
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