添加CSting 的头文件:#include “atlstr.h” string text="abc"; CString cst(text.data); GetDlgItem(IDC_XXXX)->SetWindowTextW(cst);