Click here to Skip to main content
16,005,241 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Worker Thread and Main Window Pin
John M. Drescher10-Jun-02 20:59
John M. Drescher10-Jun-02 20:59 
GeneralRe: Worker Thread and Main Window Pin
Alexandru Savescu10-Jun-02 7:15
Alexandru Savescu10-Jun-02 7:15 
GeneralRe: Worker Thread and Main Window Pin
arthivjii10-Jun-02 7:30
arthivjii10-Jun-02 7:30 
GeneralRe: Worker Thread and Main Window Pin
Neville Franks10-Jun-02 10:04
Neville Franks10-Jun-02 10:04 
Generalarguments Pin
Nnamdi Onyeyiri10-Jun-02 6:36
Nnamdi Onyeyiri10-Jun-02 6:36 
GeneralRe: arguments Pin
Chris Losinger10-Jun-02 6:53
professionalChris Losinger10-Jun-02 6:53 
GeneralReading Certificates from IE store Pin
User 988510-Jun-02 6:41
User 988510-Jun-02 6:41 
GeneralUpdateData confusion Pin
dazinith10-Jun-02 5:23
dazinith10-Jun-02 5:23 
ok.. part of my data validation on a dialog of mine checks to make sure a field isn't blank, if so the datavalidation fails and gives an error.. so heres my problem..

i have a button in the dialog which pops up another dialog and lets then choose a city in a state, when they hit ok it fills out some fields in the main dialog with the values from the citystate dialog.. like this..
UpdateData(true); // store values into variables
CCityStateDlg dlg;
if (dlg.DoModal() == IDOK)
{
m_strCity = dlg.m_strCity;
m_strState = dlg.m_strState;
UpdateData(false); // put variables into CEdit fields
}

my problem is that when UpdateData(true); gets called in the begining it causes my errors for blank fields to get called.. but if i don't call it then when i call UpdateData(false); it clears out the other fields in the dialog because the values in the fields were never put in the variables..

so is it ok to do this?
CCityStateDlg dlg;
if (dlg.DoModal() == IDOK)
{
CEdit* pCity = (CEdit*)GetDlgItem(IDC_CITY);
CEdit* pState = (CEdit*)GetDlgItem(IDC_STATE);
pCity->SetWindowText(dlg.m_strCity);
pCState->SetWindowText(dlg.m_strState);
}


and if so does that mean that UpdateData is pointless, or is it just not possible to use in this situation? Basicly i don't want to give the user the errors about blank fields when they click the button because they may fill out these other fields after they choose the city/state..

thanks for the help!

-dz
GeneralRe: UpdateData confusion Pin
Joaquín M López Muñoz10-Jun-02 5:36
Joaquín M López Muñoz10-Jun-02 5:36 
GeneralRe: UpdateData confusion Pin
Ed Gadziemski10-Jun-02 11:32
professionalEd Gadziemski10-Jun-02 11:32 
GeneralRe: UpdateData confusion Pin
dazinith11-Jun-02 3:16
dazinith11-Jun-02 3:16 
GeneralRe: UpdateData confusion Pin
dazinith11-Jun-02 3:17
dazinith11-Jun-02 3:17 
GeneralRe: UpdateData confusion Pin
John M. Drescher10-Jun-02 21:13
John M. Drescher10-Jun-02 21:13 
Generalwatch window in debug doesn't work Pin
John Oliver10-Jun-02 5:12
John Oliver10-Jun-02 5:12 
GeneralRe: watch window in debug doesn't work Pin
Joaquín M López Muñoz10-Jun-02 5:32
Joaquín M López Muñoz10-Jun-02 5:32 
QuestionHow to Dynamically add an Item to Menu? Pin
10-Jun-02 4:44
suss10-Jun-02 4:44 
AnswerRe: How to Dynamically add an Item to Menu? Pin
Lanny Thompson10-Jun-02 4:59
Lanny Thompson10-Jun-02 4:59 
AnswerRe: How to Dynamically add an Item to Menu? Pin
Alexandru Savescu10-Jun-02 5:04
Alexandru Savescu10-Jun-02 5:04 
AnswerRe: How to Dynamically add an Item to Menu? Pin
redeemer10-Jun-02 5:31
redeemer10-Jun-02 5:31 
GeneralEMail Pin
10-Jun-02 4:34
suss10-Jun-02 4:34 
GeneralRe: EMail Pin
Mazdak10-Jun-02 4:46
Mazdak10-Jun-02 4:46 
GeneralRe: EMail Pin
Ed Gadziemski10-Jun-02 11:41
professionalEd Gadziemski10-Jun-02 11:41 
GeneralRe: EMail Pin
Mazdak10-Jun-02 18:51
Mazdak10-Jun-02 18:51 
GeneralRe: EMail Pin
Ed Gadziemski11-Jun-02 2:03
professionalEd Gadziemski11-Jun-02 2:03 
QuestionHow to capture the message of a subcontrol which was created dynamicly? Pin
white jungle10-Jun-02 4:38
white jungle10-Jun-02 4:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.