Click here to Skip to main content
15,887,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: UpdateData() Behavior Pin
Makakuin5-Feb-07 11:05
Makakuin5-Feb-07 11:05 
AnswerRe: UpdateData() Behavior Pin
Makakuin5-Feb-07 11:13
Makakuin5-Feb-07 11:13 
GeneralRe: UpdateData() Behavior Pin
Mark Salsbery5-Feb-07 11:25
Mark Salsbery5-Feb-07 11:25 
GeneralRe: UpdateData() Behavior Pin
Makakuin5-Feb-07 11:28
Makakuin5-Feb-07 11:28 
GeneralRe: UpdateData() Behavior Pin
Roger Stoltz5-Feb-07 11:30
Roger Stoltz5-Feb-07 11:30 
GeneralRe: UpdateData() Behavior Pin
Mark Salsbery5-Feb-07 11:48
Mark Salsbery5-Feb-07 11:48 
GeneralRe: UpdateData() Behavior Pin
Stephen Hewitt5-Feb-07 12:38
Stephen Hewitt5-Feb-07 12:38 
GeneralRe: UpdateData() Behavior Pin
Gary R. Wheeler5-Feb-07 12:42
Gary R. Wheeler5-Feb-07 12:42 
As much as I like Dr. Newcomer's articles, I've got to disagree with him here.

For simple dialog interaction, MFC's dialog data exchange (DDX) and UpdateData() are the way to go. The wizards give you an easy way to get data into and out of your application, especially if you're new to MFC and/or Windows programming. DDX/DDV provides a consistent means of converting between Windows controls and variables in your code. For the more sophisticated, the DDX and DDV functions are an extensible framework for adding your own styles of interaction.

UpdateData isn't intended to provide 'fine' control, which seems to be the bulk of Dr. Newcomer's complaint. If you need separate controls to behave differently, or if there are dependencies between controls, then UpdateData isn't going to do what you want, since that isn't what it's designed for. For those cases, you will need to go the 'control variables' route which he advocates. The bad thing about that is, it's entirely up to you to do the transference between Windows controls and program variables yourself, along with any validation necessary. You must write a lot more code. My gut feeling is, for most dialogs, that isn't needed.


Software Zen: delete this;

GeneralRe: UpdateData() Behavior Pin
Roger Stoltz5-Feb-07 21:57
Roger Stoltz5-Feb-07 21:57 
GeneralRe: UpdateData() Behavior Pin
Mark Salsbery6-Feb-07 8:36
Mark Salsbery6-Feb-07 8:36 
GeneralRe: UpdateData() Behavior Pin
Roger Stoltz6-Feb-07 11:46
Roger Stoltz6-Feb-07 11:46 
GeneralRe: UpdateData() Behavior Pin
Mark Salsbery6-Feb-07 15:55
Mark Salsbery6-Feb-07 15:55 
GeneralRe: UpdateData() Behavior Pin
Gary R. Wheeler6-Feb-07 12:07
Gary R. Wheeler6-Feb-07 12:07 
GeneralRe: UpdateData() Behavior Pin
Roger Stoltz6-Feb-07 12:41
Roger Stoltz6-Feb-07 12:41 
AnswerRe: UpdateData() Behavior Pin
ThatsAlok6-Feb-07 20:00
ThatsAlok6-Feb-07 20:00 
QuestionMake MFC View "read only" while allowing viewing, scrolling etc. Pin
lctrncs5-Feb-07 9:43
lctrncs5-Feb-07 9:43 
AnswerRe: Make MFC View "read only" while allowing viewing, scrolling etc. Pin
Mark Salsbery5-Feb-07 11:37
Mark Salsbery5-Feb-07 11:37 
GeneralRe: Make MFC View "read only" while allowing viewing, scrolling etc. Pin
lctrncs7-Feb-07 4:36
lctrncs7-Feb-07 4:36 
QuestionVS2005 trial: Registered messages issue Pin
Joan M5-Feb-07 9:33
professionalJoan M5-Feb-07 9:33 
AnswerRe: VS2005 trial: Registered messages issue Pin
Michael Dunn5-Feb-07 9:53
sitebuilderMichael Dunn5-Feb-07 9:53 
AnswerRe: VS2005 trial: Registered messages issue Pin
Gary R. Wheeler5-Feb-07 12:19
Gary R. Wheeler5-Feb-07 12:19 
QuestionAdvanced VC++ 6.0 Book/Reference Pin
acerunner3165-Feb-07 9:23
acerunner3165-Feb-07 9:23 
AnswerRe: Advanced VC++ 6.0 Book/Reference Pin
Christian Graus5-Feb-07 9:32
protectorChristian Graus5-Feb-07 9:32 
GeneralRe: Advanced VC++ 6.0 Book/Reference Pin
acerunner3165-Feb-07 9:44
acerunner3165-Feb-07 9:44 
GeneralRe: Advanced VC++ 6.0 Book/Reference Pin
David Crow5-Feb-07 10:03
David Crow5-Feb-07 10:03 

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.