GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 18-Oct-2005, 16:39
kobycool kobycool is offline
New Member
 
Join Date: Oct 2005
Posts: 2
kobycool is on a distinguished road

UpdateData - simple MFC project


hello,
Im trying to run simple MFC application program using UpdateData function.
I defined simple dialog with Edit Control and I added variable as CString and when I push the OK button I want it to show me the text.
under the following event:
void CHelloDialogDlg::OnBnClickedOk()
{
UpdateData(TRUE);
AfxMessageBox(m_string);
//OnOK();
}

but m_string have nothing after UpdateData.

Do I miss something???

thanks
Koby
  #2  
Old 19-Oct-2005, 03:58
Janakiraman Janakiraman is offline
Junior Member
 
Join Date: Apr 2005
Location: Chennai - India
Posts: 47
Janakiraman is on a distinguished road

Re: UpdateData - simple MFC project



Hi,

Try this...
void CHelloDialogDlg::OnBnClickedOk()
{
char text[10]; //buffer to store editbox contents
//UpdateData(TRUE);
editCtrl->GetWindowText(text,12); //editCtrl - object of edit ctrl
AfxMessageBox(text);

}
  #3  
Old 21-Oct-2005, 11:05
kobycool kobycool is offline
New Member
 
Join Date: Oct 2005
Posts: 2
kobycool is on a distinguished road

Re: UpdateData - simple MFC project


thanks for your answer, but,
how can I use the editCtrl(I tried this: editCtrl->... but I get errors while compiling)???
thanks
koby
  #4  
Old 23-Oct-2005, 03:45
codavid codavid is offline
New Member
 
Join Date: Feb 2005
Posts: 20
codavid is on a distinguished road

Re: UpdateData - simple MFC project


u can use 'editCtrl' haha...cuz u dont declare a CEdit controle!
i know wat u mean, u want to use the DDX.
to ues DDX, not only should u add a variable, and use UpdateDate(TRUE), but also do somechang in the DoDataExchange(...) member function
 
 

Recent GIDBlogProgramming ebook direct download available by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with Simple 1D Array coding project rho C++ Forum 2 27-Jun-2005 20:05
c programming : project idea ??? batrsau C++ Forum 2 09-Jun-2005 05:55
Community Project Proposal dsmith Miscellaneous Programming Forum 71 19-Feb-2005 13:26
GIMcontacts - a gim fltk fluid venture cable_guy_67 FLTK Forum 0 14-Feb-2005 15:18
Need help on simple Programming Project daNichex6 C Programming Language 1 03-Sep-2004 19:08

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 22:29.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.