The control does not use unicode, I have checked that. As I wrote, the problem only occurs if I enable XP visual styles and themes for the application by including a manifest file in the executables directory. I already tried to write replacements for Get/SetWindowText: void CGXEditControl::GetWindowText(CString& s) { if (IsThemeActive()) { const int nLen = ::GetWindowTextLengthW(m_hWnd); CStringW sW; ::GetWindowTextW(m_hWnd, sW.GetBufferSetLength(nLen), nLen+1); sW.ReleaseBuffer(); s = sW; } else { //CGXEditControl is derived from CEdit, CGXStatic CEdit::GetWindowText(s); } } void CGXEditControl::SetWindowText(const CString& s) { if (IsThemeActive()) { CStringW sW(s); ::SetWindowTextW(GetSafeHwnd(), sW); } else { CEdit::SetWindowText(s); } } This prevents the heap corruption, but then the edit control contains a lot of unreadable stuff like arabic letters :omg: even though the debugger shows that sW seems to contain a correct string like "1120". The problem seems to be the registration process of the class GXEDIT. In CGXEditControl::CreateControl, if I replace the class name "GXEDIT" with the standard "edit" class in the call to CEdit::Create, everything works! But I don't know what side effects this will have for the rest of the library :confused:, so I want to avoid this workaround if possible. BTW, this library is a very antique version of Stingray's Objective Grid, dated 1997 :-O . Regards, Jens