Take input from a MFC Control as string :
Here IDC_EDIT1 is the Control Edit Text and txtname is the input at the moment we call.
Convert it to integer or int :
CString txtname;
GetDlgItemText(IDC_EDIT1, txtname);
Here IDC_EDIT1 is the Control Edit Text and txtname is the input at the moment we call.
Convert it to integer or int :
int iPort = _atoi( txtname.GetString() );
int iPort = _wtoi( txtname.GetString() );
// if you use wide charater formats
Append text to Edit Control :
void CServerDlg::AppendTextToEditCtrl(CEdit& edit, LPCTSTR pszText){// get the initial text lengthint nLength = edit.GetWindowTextLength();// put the selection at the end of textedit.SetSel(nLength, nLength);// replace the selectionedit.ReplaceSel(pszText);}
Comments
Post a Comment