} break; 用了CString str; GetDlgItem(IDC_EDIT1)->GetWindowText(str) if(-1 == str.Find("x")) not found后显示error C2664: 'void __thiscall CWnd::GetWindowTextA(class CString &) const' : cannot convert parameter 1 from 'char [8]' to 'class CString &' A reference that is not to 'const' cannot be bound to a non-lvalue Error executing cl.exe.的错误,这个应该是指返回值只有-1这一个吧,没有非-1的返回值也就不能用if else啦 大家帮我看下啊·
GetDlgItem(IDC_EDIT1)->GetWindowText(str)
if(-1 == str.Find("xxx"))
not found
GetDlgItem(IDC_EDIT1)->GetWindowText(str)
if(-1 == str.Find("x"))
not found
case 0:
{UpdateData();
GetDlgItem(IDC_EDIT1)->GetWindowText("m_edit1"); if(-1 == m_edit1.Find("."))
{CString num;
num.Format(_T("%s"),".");
CEdit *m_Edit=(CEdit *)GetDlgItem(IDC_EDIT1);
int nLen=m_Edit->GetWindowTextLength();
m_Edit->SetSel(nLen, nLen);
m_Edit->ReplaceSel(num); }
else{
}
}
break;
用了CString str;
GetDlgItem(IDC_EDIT1)->GetWindowText(str)
if(-1 == str.Find("x"))
not found后显示error C2664: 'void __thiscall CWnd::GetWindowTextA(class CString &) const' : cannot convert parameter 1 from 'char [8]' to 'class CString &'
A reference that is not to 'const' cannot be bound to a non-lvalue
Error executing cl.exe.的错误,这个应该是指返回值只有-1这一个吧,没有非-1的返回值也就不能用if else啦
大家帮我看下啊·