String str(newVal); int count = str.size(); if(count>31) { count = 31; } wcsncpy(m_info.faceName,str.c_str(),count); m_info.faceName[count] = _T('\0');