I need to make this more compact.
-
I like to write lines of code that are very short and very simple to understand. Is there a way that I can communicate this in a shorter more compact form? CEdit *idcinput = (CEdit *) GetDlgItem(IDC_INPUT); char cinput[255]; idcinput->GetWindowText(cinput, 255); CString sinput = cinput; Thank you, Eric Sepich
-
I like to write lines of code that are very short and very simple to understand. Is there a way that I can communicate this in a shorter more compact form? CEdit *idcinput = (CEdit *) GetDlgItem(IDC_INPUT); char cinput[255]; idcinput->GetWindowText(cinput, 255); CString sinput = cinput; Thank you, Eric Sepich
don't use C string when using MFC. replace with
CEdit *idcinput = (CEdit *) GetDlgItem(IDC_INPUT);
CString sinput;
idcinput->GetWindowText(sinput );
Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
-
I like to write lines of code that are very short and very simple to understand. Is there a way that I can communicate this in a shorter more compact form? CEdit *idcinput = (CEdit *) GetDlgItem(IDC_INPUT); char cinput[255]; idcinput->GetWindowText(cinput, 255); CString sinput = cinput; Thank you, Eric Sepich
esepich wrote: I like to write lines of code that are very short and very simple to understand If you made the edit control a member variable, then your code could be accomplished with:
CString sinput; m_EditCtrl.GetWindowText(&sinput);
-
I like to write lines of code that are very short and very simple to understand. Is there a way that I can communicate this in a shorter more compact form? CEdit *idcinput = (CEdit *) GetDlgItem(IDC_INPUT); char cinput[255]; idcinput->GetWindowText(cinput, 255); CString sinput = cinput; Thank you, Eric Sepich
Or declare a CString member variable of the IDC_INPUT in ClassWizard and call UpdateData(TRUE); m_strYourdata; //your data already being updated and m_strYourdata is ready to be used. Sonork 100.41263:Anthony_Yio
-
I like to write lines of code that are very short and very simple to understand. Is there a way that I can communicate this in a shorter more compact form? CEdit *idcinput = (CEdit *) GetDlgItem(IDC_INPUT); char cinput[255]; idcinput->GetWindowText(cinput, 255); CString sinput = cinput; Thank you, Eric Sepich
CString sData;
GetDlgItemText( IDC_INPUT, sData );