MFC DIALOG TEXTBOX

So today i started my First MFC dialog based application. I have done Win32 GUI & Forms Programming, but my question is, In a MFC application how do you store a value from a text Box?
iirc:
 
CString sometext = myeditctrl.GetWindowText();


Been a long time since I used MFC though. It's probably something like that. If that's not exactly right, look up GetWindowText
*******EDIT*********
Ok i figured it out, im stupid and wasnt setting a CString to store the text in;
For any of you that have the same question this is how i got it to work, pretty simple:
1
2
3
CString s;
m_text1.GetWindowText(s);
m_text2.SetWindowText(s);


and also how can I convert a Cstring to a Int or double??

******EDIT**********
I solved my own problem, im used to using the CONVERT:: function but
in MFC its
1
2
3
4
5
6
7
CString s;
myWindow.GetWindowText(s);

int temp = atoi(s); // CString to Int

s.Format("%d",temp); // Back To CString


Last edited on
Topic archived. No new replies allowed.