Click here to Skip to main content
16,006,845 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Immediately start an action when a dialog box is showed Pin
Anna-Jayne Metcalfe31-May-01 23:52
Anna-Jayne Metcalfe31-May-01 23:52 
GeneralRe: Immediately start an action when a dialog box is showed Pin
1-Jun-01 0:00
suss1-Jun-01 0:00 
GeneralRe: Immediately start an action when a dialog box is showed Pin
2-Jun-01 8:20
suss2-Jun-01 8:20 
GeneralData movement between CString && string Pin
31-May-01 18:10
suss31-May-01 18:10 
GeneralRe: Data movement between CString && string Pin
hearties31-May-01 21:26
hearties31-May-01 21:26 
GeneralRe: Data movement between CString && string Pin
Miroslav Rajcic31-May-01 22:14
Miroslav Rajcic31-May-01 22:14 
GeneralDialog Help! Pin
Joseph LeBlanc31-May-01 15:05
Joseph LeBlanc31-May-01 15:05 
GeneralRe: Dialog Help! Pin
Christian Graus31-May-01 15:17
protectorChristian Graus31-May-01 15:17 
Ah - the dreaded M$ screwed up DDX bug.

You make them CStrings, as you thought, and keep the ints as a seperate variable. Hungarian notation is good here, ie m_szValue/m_iValue. Now go to your dialog editor and click on each edit box and add a handler function for EN_CHANGE ( from memory, it's the one that you get when someone types text ).


Now in your handler, UpdateData() to get the value in, parse it and pass the value to the int only if it is valid, but bring up a dialog only if the value given is positively wrong, rather than empty or on the way to being right ( i.e. if you accept 5-100, don't complain about < 100 until user presses OK, as they may have been entering 10, 27, 43, etc ).

Christian

#include "std_disclaimer.h"

People who love sausage and respect the law should never watch either one being made.

The things that come to those who wait are usually the things left by those who got there first.
GeneralRe: Dialog Help! Pin
1-Jun-01 3:39
suss1-Jun-01 3:39 
GeneralWant Easy E-mail for automated process Pin
Mark Terrano31-May-01 13:17
Mark Terrano31-May-01 13:17 
GeneralRe: Want Easy E-mail for automated process Pin
Ravi Bhavnani31-May-01 13:26
professionalRavi Bhavnani31-May-01 13:26 
GeneralWierd problem saving in GDI+ Pin
Christian Graus31-May-01 12:33
protectorChristian Graus31-May-01 12:33 
GeneralRe: Wierd problem saving in GDI+ Pin
Michael Dunn31-May-01 18:38
sitebuilderMichael Dunn31-May-01 18:38 
GeneralRe: Wierd problem saving in GDI+ Pin
Christian Graus31-May-01 19:27
protectorChristian Graus31-May-01 19:27 
GeneralInterfacing VB & C++ BSTR* v. BSTR Pin
31-May-01 11:34
suss31-May-01 11:34 
GeneralRe: Interfacing VB & C++ BSTR* v. BSTR Pin
Carlos Antollini31-May-01 11:45
Carlos Antollini31-May-01 11:45 
GeneralRe: Interfacing VB & C++ BSTR* v. BSTR Pin
[James Pullicino]1-Jun-01 3:18
[James Pullicino]1-Jun-01 3:18 
GeneralRe: Interfacing VB & C++ BSTR* v. BSTR Pin
Carlos Antollini1-Jun-01 3:47
Carlos Antollini1-Jun-01 3:47 
GeneralHandling Tab and Esc Keys Pin
ThunderBird31-May-01 9:12
ThunderBird31-May-01 9:12 
GeneralDisplay Text on Screen Pin
31-May-01 8:14
suss31-May-01 8:14 
GeneralRe: Display Text on Screen Pin
Christian Graus31-May-01 8:20
protectorChristian Graus31-May-01 8:20 
QuestionHow to start MFC Pin
31-May-01 7:16
suss31-May-01 7:16 
AnswerRe: How to start MFC Pin
Christian Graus31-May-01 8:16
protectorChristian Graus31-May-01 8:16 
GeneralRe: How to start MFC Pin
31-May-01 10:51
suss31-May-01 10:51 
GeneralRe: How to start MFC Pin
Sab3awy31-May-01 14:15
Sab3awy31-May-01 14:15 

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.