给B添加一个方法void B::SetText(const UINT id, const CString str){CWnd* pWnd = GetDlgItem(id);pWnd->SetWindowText(str);}在A中调用这个函数即可。