Click here to Skip to main content
15,917,731 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMenu on CFormView Derived Pin
aman200626-Oct-04 6:27
aman200626-Oct-04 6:27 
GeneralKnowing resource ID Pin
0v3rloader26-Oct-04 6:02
0v3rloader26-Oct-04 6:02 
Generallong compile time ... vs.net 2003 ... Pin
Maximilien26-Oct-04 5:57
Maximilien26-Oct-04 5:57 
GeneralRe: long compile time ... vs.net 2003 ... Pin
Blake Miller26-Oct-04 6:02
Blake Miller26-Oct-04 6:02 
Questionwhere am i mistaking here? Pin
Natural_Demon26-Oct-04 5:35
Natural_Demon26-Oct-04 5:35 
AnswerRe: where am i mistaking here? Pin
Blake Miller26-Oct-04 6:09
Blake Miller26-Oct-04 6:09 
GeneralRe: where am i mistaking here? Pin
Natural_Demon26-Oct-04 8:23
Natural_Demon26-Oct-04 8:23 
GeneralRe: where am i mistaking here? Pin
Blake Miller27-Oct-04 4:45
Blake Miller27-Oct-04 4:45 
You should be able to do all your data sets and retrievals within the DoDataExchange
similar to something like this:

void Cfirstw32mfcDlg::DoDataExchange(CDataExchange* pDX)
{
CDHtmlDialog::DoDataExchange(pDX);

// data TO controls, means LOAD strings with your existing data or default values
// you need to do this BEFORE the DDX_DHtml_ElementInnerText calls

if( !pDX->m_bSaveAndValidate ){
EDIT1 = AfxGetApp()->GetProfileString("Settings", "email", "your login");
EDIT2 = AfxGetApp()->GetProfileString("Settings", "password", "details here..");
}

// these calls presumably set or get the data from the controls into your string variables
DDX_DHtml_ElementInnerText(pDX, _T("email"), EDIT1);
DDX_DHtml_ElementInnerText(pDX, _T("password"), EDIT2);
DDX_DHtml_ElementInnerText(pDX, _T("Temp_Text1"), m_EDIT1);
DDX_DHtml_ElementInnerText(pDX, _T("Temp_Text2"), m_EDIT2);

// data FROM controls, means SAVE data from the controls to your storage
// you need to do this AFTER the DDX_DHtml_ElementInnerText calls
if( pDX->m_bSaveAndValidate ){

GetElementText(_T("email"));
AfxGetApp()->WriteProfileString("Settings", "email", EDIT1);

GetElementText(_T("password"));
AfxGetApp()->WriteProfileString("Settings", "password", EDIT2);
}

}


If the DoDataExchange is correctly implemented, you don't even need to have the OnOK handler, since the DoDataExchange will be called for you (I am pretty sure) and you definitely don't need the Cancel, because the UpdatData (and thus DoDataExchange) is not called at all.



GeneralGet Row & Column for a listCtrl Pin
sweep12326-Oct-04 4:37
sweep12326-Oct-04 4:37 
GeneralRe: Get Row & Column for a listCtrl Pin
David Crow26-Oct-04 5:07
David Crow26-Oct-04 5:07 
GeneralRe: Get Row & Column for a listCtrl Pin
sweep12326-Oct-04 6:23
sweep12326-Oct-04 6:23 
GeneralRe: Get Row & Column for a listCtrl Pin
Rage26-Oct-04 7:10
professionalRage26-Oct-04 7:10 
GeneralRe: Get Row & Column for a listCtrl Pin
Grahamfff26-Oct-04 9:38
Grahamfff26-Oct-04 9:38 
Questionhow can i have only client area of window Pin
efanHarris26-Oct-04 4:35
efanHarris26-Oct-04 4:35 
AnswerRe: how can i have only client area of window Pin
David Crow26-Oct-04 4:42
David Crow26-Oct-04 4:42 
GeneralRe: how can i have only client area of window Pin
efanHarris26-Oct-04 20:16
efanHarris26-Oct-04 20:16 
GeneralRe: how can i have only client area of window Pin
David Crow27-Oct-04 10:30
David Crow27-Oct-04 10:30 
GeneralIs there any free Modem Simulator which can tell Call States or some other way to debug Modem application with Modem Pin
Kapoor Vikrant26-Oct-04 4:28
Kapoor Vikrant26-Oct-04 4:28 
GeneralRe: Is there any free Modem Simulator which can tell Call States or some other way to debug Modem application with Modem Pin
Blake Miller26-Oct-04 6:14
Blake Miller26-Oct-04 6:14 
QuestionHow to dump information into text file which I got from _CrtDumpMemoryLeaks() ? Pin
Amarelia26-Oct-04 4:24
Amarelia26-Oct-04 4:24 
GeneralBuilding Wizards Pin
shevi202726-Oct-04 2:57
shevi202726-Oct-04 2:57 
GeneralRe: Building Wizards Pin
Blake Miller26-Oct-04 6:17
Blake Miller26-Oct-04 6:17 
GeneralFail to bind the socket Pin
amitranjanmishra26-Oct-04 1:23
amitranjanmishra26-Oct-04 1:23 
GeneralRe: Fail to bind the socket Pin
dharani26-Oct-04 21:20
dharani26-Oct-04 21:20 
GeneralRe: Fail to bind the socket Pin
amitranjanmishra27-Oct-04 3:21
amitranjanmishra27-Oct-04 3:21 

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.