Click here to Skip to main content
15,894,405 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Comparing two strings, works in debug, fails in release Pin
Anthony Mushrow5-Feb-07 16:58
professionalAnthony Mushrow5-Feb-07 16:58 
GeneralRe: Comparing two strings, works in debug, fails in release Pin
jhwurmbach5-Feb-07 22:57
jhwurmbach5-Feb-07 22:57 
AnswerRe: Comparing two strings, works in debug, fails in release Pin
ThatsAlok6-Feb-07 19:59
ThatsAlok6-Feb-07 19:59 
GeneralRe: Comparing two strings, works in debug, fails in release Pin
Anthony Mushrow7-Feb-07 2:17
professionalAnthony Mushrow7-Feb-07 2:17 
QuestionFunction nesting error Pin
dellthinker5-Feb-07 13:43
dellthinker5-Feb-07 13:43 
AnswerRe: Function nesting error Pin
Mark Salsbery5-Feb-07 13:48
Mark Salsbery5-Feb-07 13:48 
AnswerWhat are you doing ?!! ;) Pin
Mohammad Rastkar5-Feb-07 15:57
Mohammad Rastkar5-Feb-07 15:57 
AnswerRe: Function nesting error Pin
Stephen Hewitt5-Feb-07 16:13
Stephen Hewitt5-Feb-07 16:13 
QuestionUpdateData() Behavior Pin
Makakuin5-Feb-07 10:50
Makakuin5-Feb-07 10:50 
AnswerRe: UpdateData() Behavior Pin
David Crow5-Feb-07 11:01
David Crow5-Feb-07 11:01 
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 
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 
Roger Stoltz wrote:
DDV should not be done unless the user performs some kind of "save" operation


DDV routines only validate on save operations. The first argument to the DDV routines is a pointer to an object of type CDataExchange, which includes the member m_bSaveAndValidate. All of Microsoft's DDV routines check this value prior to issuing an error. This value is TRUE only if you call UpdateData(TRUE), which means you are doing a save operation.

This seems wasteful, until you see how economical it is. You code a single DoDataExchange function that works for both moving program variables into Windows controls, and then back again. For each control, you have one statement that handles the transfer, and a second statement that handles the validation.

Roger Stoltz wrote:
Another side effect is that if you choose to validate the data of a control when the data changes, the data of all the controls in the dialog will be both exchanged and validated which I consider unnecessary and it implies that this is not the way it should be done.


UpdateData() is intended for use in dialog boxes that are essentially "fill-in-the-blank" forms. This was the primary behavior and use of dialogs when MFC was first created.

Developers discovered how easy dialog programming is. As a result, more and more applications were written as dialog apps. Dialogs are now applications made up of controls, and the "fill-in-form" metaphor is less applicable.

I'm simply trying to point out that Dr. Newcomer's out-of-hand rejection of DDX/DDV and UpdateData ignores perfectly valid uses of the facility, especially for simple applications.


Software Zen: delete this;

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 

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.