15,981
社区成员




/*
CString str;
GetDlgItem(IDC_EDIT1)->GetWindowText(str);
MessageBox(str);
*/
/*
CString str;
GetDlgItemText(IDC_EDIT1,str);
MessageBox(str);
*/
//上面两种办法最后都是通过调用API的实现的,殊途同归
char str[20]={0};
::GetWindowText(::GetDlgItem(m_hWnd,IDC_EDIT1),str,20);
MessageBox(str);
CString str;
CWnd * pWnd = GetDlgItem( IDC_EDIT1 );
pWnd->GetWindowText( str );
MessageBox( str );
CString str;
GetDlgItemText(IDC_EDIT1,str);
MessageBox(str);
CString str;
GetDlgItem(IDC_EDIT1)->GetWindowText(str);
MessageBox(str);