Question : CEdit GetWindowText() for a UNICODE string

CEdit m_cEdit;

In the dialog OnInitDialog()

SubclassDlgItem(IDC_EDIT1, this);

At some time :

CString str = _T("001122334455");

m_cEdit.SetWindowText(str);  // dispalys correctly.

Getting the string is the problem.

CString s;

m_cEdit.GetWindowText(s);

s only contains  the first character 0

My MFC VC6 project has just been converted to UNICODE. i.e. compiler and linker options set to handle UNICODE.

This is the only thing that does not work, everything else appear to be OK...

What is the trick to getting a UNICODE string back from a CEdit control ?
















Answer : CEdit GetWindowText() for a UNICODE string

Have a look to:
http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20830475.html
Random Solutions  
 
programming4us programming4us