..... CStatic m_str1;
CString m_str;
......CDialog1::CDialog1(CWnd* pParent /*=NULL*/)
: CDialog(CDialog1::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialog1)
m_str = _T("");
m_str1.SetWindowText("xa");//这步为什么不行呢 构造函数已经在这里的时候把m_str1对象构造好了
//}}AFX_DATA_INIT
}
.....
CString m_str;
......CDialog1::CDialog1(CWnd* pParent /*=NULL*/)
: CDialog(CDialog1::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialog1)
m_str = _T("");
m_str1.SetWindowText("xa");//这步为什么不行呢 构造函数已经在这里的时候把m_str1对象构造好了
//}}AFX_DATA_INIT
}
.....
构造的时候还没有窗口句柄
在OnInitDialog里面设置吧
: CDialog(CDialog1::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialog1)
m_str = _T("");
m_str1.SetWindowTex……
不能放到这里,放到OnInitDialog里