Click here to Skip to main content
15,907,326 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: the question of "sizeof"! Pin
CPallini14-Apr-10 3:22
mveCPallini14-Apr-10 3:22 
GeneralRe: the question of "sizeof"! Pin
wbgxx14-Apr-10 3:28
wbgxx14-Apr-10 3:28 
AnswerRe: the question of "sizeof"! Pin
Stephen Hewitt14-Apr-10 4:25
Stephen Hewitt14-Apr-10 4:25 
QuestionRe: the question of "sizeof"! Pin
Chris Meech14-Apr-10 7:02
Chris Meech14-Apr-10 7:02 
AnswerRe: the question of "sizeof"! Pin
CPallini14-Apr-10 11:24
mveCPallini14-Apr-10 11:24 
AnswerRe: the question of "sizeof"! Pin
SpaceMonkey197014-Apr-10 7:59
SpaceMonkey197014-Apr-10 7:59 
GeneralRe: the question of "sizeof"! Pin
Stephen Hewitt14-Apr-10 13:48
Stephen Hewitt14-Apr-10 13:48 
QuestionAvoid "Data Exchange" validation Pin
Code-o-mat14-Apr-10 0:04
Code-o-mat14-Apr-10 0:04 
Hello people!

Yes, i was stupid enough to use the "Data Exchange and validation" method of MFC (UpdateData, CDialog::DoDataExchange and co.) and now i have to suffer the consequences. Is there a way to easily retrieve the values the user entered into the edit fields with this BUT do not let DDX do validation, or at least do it silently. What i did was to create a few dialogs with a whole bunch of edit controls on them that let the user hammer in all kinds of data, mostly numbers, when the OK button is hit, i called UpdateData to move the user's entries into integer values and then check these for correctness and display a message box if something's wrong. This works ok as long as the user entered something into the edit fields, but if the user leaves one empty, then during the Dataexchange process a nice little "Please enter an integer" message box is spit up, after dismissing this the user gets my own message. I googled around and found only solutions like:
-don't use DDX at all (I really don't like DDX, now i wonder why i thought i would use it now, probably because it seemd faster to implement than having to manually retrieve entries and convert them to needed types...)
-don't use integers, use CString-s to get the data and then convert to numbers yourself...
-use CEdit instead of simple data members and retrieve the value using GetWindowText and then convert to number
-before calling DoDataExhcnage put a "0" into every numeric edit field on the dialog that is empty
All of these might work but they all require a lot of "rewriting the whole thing" which i would like to avoid if possible, so my question is: does anyone of you know of any way to make DDX retrieve values from the controls silently, so without throwing up message boxes and stopping after the first problem it hits? DDX should be way more flexible then this...nice one MS...

Thanks in advance.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <

AnswerRe: Avoid "Data Exchange" validation Pin
Eugen Podsypalnikov14-Apr-10 0:21
Eugen Podsypalnikov14-Apr-10 0:21 
GeneralRe: Avoid "Data Exchange" validation Pin
Code-o-mat14-Apr-10 0:50
Code-o-mat14-Apr-10 0:50 
GeneralRe: Avoid "Data Exchange" validation Pin
Eugen Podsypalnikov14-Apr-10 1:01
Eugen Podsypalnikov14-Apr-10 1:01 
GeneralRe: Avoid "Data Exchange" validation Pin
Code-o-mat14-Apr-10 1:06
Code-o-mat14-Apr-10 1:06 
AnswerRe: Avoid "Data Exchange" validation Pin
Niklas L14-Apr-10 0:57
Niklas L14-Apr-10 0:57 
GeneralRe: Avoid "Data Exchange" validation Pin
Code-o-mat14-Apr-10 1:02
Code-o-mat14-Apr-10 1:02 
AnswerRe: Avoid "Data Exchange" validation Pin
David Crow14-Apr-10 3:08
David Crow14-Apr-10 3:08 
AnswerRe: Avoid "Data Exchange" validation Pin
Maximilien14-Apr-10 4:46
Maximilien14-Apr-10 4:46 
QuestionChanging Printer Settings to ensure Landscape print [modified] Pin
maycockt13-Apr-10 23:27
maycockt13-Apr-10 23:27 
QuestionRe: Changing Printer Settings to ensure Landscape print Pin
David Crow14-Apr-10 3:13
David Crow14-Apr-10 3:13 
AnswerRe: Changing Printer Settings to ensure Landscape print Pin
@Intersect☺™14-Apr-10 4:22
professional@Intersect☺™14-Apr-10 4:22 
Questionexcel Pin
trioum13-Apr-10 23:18
trioum13-Apr-10 23:18 
QuestionRe: excel Pin
enhzflep13-Apr-10 23:46
enhzflep13-Apr-10 23:46 
AnswerRe: excel Pin
@Intersect☺™14-Apr-10 4:24
professional@Intersect☺™14-Apr-10 4:24 
AnswerRe: excel Pin
ThatsAlok14-Apr-10 19:31
ThatsAlok14-Apr-10 19:31 
Questioncolumn width of ListView Pin
arun_pk13-Apr-10 22:18
arun_pk13-Apr-10 22:18 
AnswerRe: column width of ListView Pin
CPallini13-Apr-10 22:24
mveCPallini13-Apr-10 22:24 

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.