
Display values in a Text Box?
Quote:
> >There is no good reason at all not to use UpdateData etc in a dialog.
Maybe I should have worded my statement as:
"there is no good reason at all why UpdateData cannot be used in a
dialog"
That is what I was trying to say.
Quote:
> In the real world things are never so black and white.
[snip]
> As in most programming, there are few solid rules, use whatever method
> best fits the requirement.
Indeed ... and thats _exactly_ why I don't like the article referred to.
It's author claims that you should NEVER use UpdateData in a dialog because
it doesn't work and is flawed. However, the reason _why_ his examples have
problems is that he is not utilising dialogs and ddx etc in an
MFC-compatible way .. ie the problemis really with the way he writes his
programs, not anything inherently wrong with UpdateData etc.
Its a bit like saying "don't use the ++ operator because 'i = i++;' gives
strange behaviour" whereas one should be saying "don't write code like 'i =
i++;' because that is not appropriate use of the ++ operator".
Hopefully that better illustrates the point I was trying to make here.
--
Roger Onslow
Software Developer
See my articles at http://www.codeguru.com
See the product I am working on at http://www.swishzone.com
"Operator .. give me the number for 911" .. Homer Simpson
Quote:
> >There is no good reason at all not to use UpdateData etc in a dialog.
> Roger,
> In the real world things are never so black and white.
> For the use that this person wanted (to repeatedly update an edit
> control), the more efficient method is to use SetDlgItemText/Int
> directly (or through a member control variable).
> Using UpdateData updates all the DDX member variables - which means
> unnecessary extra code is running, and in a complex dialog it may well
> be totally the wrong thing to do.
> As in most programming, there are few solid rules, use whatever method
> best fits the requirement.
> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq
> My address is altered to discourage junk mail.
> Please post responses to the newsgroup thread,
> there's no need for follow-up email copies.