it fails to retrieve newly intruduced data by the user
-
it fails to retrieve newly intruduced data by the user. i tried this ... AfxGetApp()->WriteProfileString("Settings", "email", EDIT1); UpdateData(FALSE); and this.. CDHtmlDialog::GetElementText(_T("email")); if(CDHtmlDialog::GetElementText(_T("email"))) { EDIT1=_T("works"); } else { EDIT1=_T("it doesn't work"); } i tried many combination and searching answer, but i can't find one right. this is qwhat i do on init BOOL Cfirstw32mfcDlg::OnInitDialog() { .. .. .. ... EDIT1 = AfxGetApp()->GetProfileString("Settings", "email", "your login"); EDIT2 = AfxGetApp()->GetProfileString("Settings", "password", "details here.."); UpdateData(FALSE); //EDIT1=(""); //EDIT2=(""); UpdateData(FALSE); return FALSE; // return TRUE unless you set the focus to a control } EDIT1 and EDIT2 contain values, either from the register or the alternative 'default value'and it wil be displayed in the userinterface it's also visible in the userinterface, but if i intruduce values manualy and press ok, 'UpdateData(FALSE);' doesn't update anything, nor UpdateData();,UpdateData(TRUE); or UpdateDialogControls(this, FALSE); i tried resting the values as u can see, but than the entries in the registry are also empty what am i doing wrong here thanx for your time and kind regards, marco // firstw32mfcDlg.cpp : implementation file // #include "stdafx.h" #include "firstw32mfc.h" #include "firstw32mfcDlg.h" #include ".\firstw32mfcdlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CAboutDlg dialog used for App About class CAboutDlg : public CDialog { public: CAboutDlg(); // Dialog Data enum { IDD = IDD_ABOUTBOX }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support // Implementation protected: DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) END_MESSAGE_MAP() // Cfirstw32mfcDlg dialog BEGIN_DHTML_EVENT_MAP(Cfirstw32mfcDlg) DHTML_EVENT_ONCLICK(_T("ButtonOK"), OnButtonOK) DHTML_EVENT_ONCLICK(_T("ButtonCancel"), OnButtonCancel) DHTML_EVENT_ONCHANGE(_T("email"), OnEnChangeEdit1 ) DHTML_EVENT_ONCHANGE(_T("password"), OnEnChangeEdit2 ) END_DHTML_EVENT_MAP() Cfirstw32mfcDlg::Cfirstw32mfcDlg(CWnd* pParent /*=NULL*/) : CDHtmlDialog(Cfirstw32mfcDlg::IDD, Cfirstw32mfcDlg::IDH, pParent) //, m_EDIT1(0) //, m_EDIT2(0) { m_hIcon
-
it fails to retrieve newly intruduced data by the user. i tried this ... AfxGetApp()->WriteProfileString("Settings", "email", EDIT1); UpdateData(FALSE); and this.. CDHtmlDialog::GetElementText(_T("email")); if(CDHtmlDialog::GetElementText(_T("email"))) { EDIT1=_T("works"); } else { EDIT1=_T("it doesn't work"); } i tried many combination and searching answer, but i can't find one right. this is qwhat i do on init BOOL Cfirstw32mfcDlg::OnInitDialog() { .. .. .. ... EDIT1 = AfxGetApp()->GetProfileString("Settings", "email", "your login"); EDIT2 = AfxGetApp()->GetProfileString("Settings", "password", "details here.."); UpdateData(FALSE); //EDIT1=(""); //EDIT2=(""); UpdateData(FALSE); return FALSE; // return TRUE unless you set the focus to a control } EDIT1 and EDIT2 contain values, either from the register or the alternative 'default value'and it wil be displayed in the userinterface it's also visible in the userinterface, but if i intruduce values manualy and press ok, 'UpdateData(FALSE);' doesn't update anything, nor UpdateData();,UpdateData(TRUE); or UpdateDialogControls(this, FALSE); i tried resting the values as u can see, but than the entries in the registry are also empty what am i doing wrong here thanx for your time and kind regards, marco // firstw32mfcDlg.cpp : implementation file // #include "stdafx.h" #include "firstw32mfc.h" #include "firstw32mfcDlg.h" #include ".\firstw32mfcdlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CAboutDlg dialog used for App About class CAboutDlg : public CDialog { public: CAboutDlg(); // Dialog Data enum { IDD = IDD_ABOUTBOX }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support // Implementation protected: DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) END_MESSAGE_MAP() // Cfirstw32mfcDlg dialog BEGIN_DHTML_EVENT_MAP(Cfirstw32mfcDlg) DHTML_EVENT_ONCLICK(_T("ButtonOK"), OnButtonOK) DHTML_EVENT_ONCLICK(_T("ButtonCancel"), OnButtonCancel) DHTML_EVENT_ONCHANGE(_T("email"), OnEnChangeEdit1 ) DHTML_EVENT_ONCHANGE(_T("password"), OnEnChangeEdit2 ) END_DHTML_EVENT_MAP() Cfirstw32mfcDlg::Cfirstw32mfcDlg(CWnd* pParent /*=NULL*/) : CDHtmlDialog(Cfirstw32mfcDlg::IDD, Cfirstw32mfcDlg::IDH, pParent) //, m_EDIT1(0) //, m_EDIT2(0) { m_hIcon
I think you can go for simple registry class known CRegKey defined in atlbase.h ----------------------------- "I Think It Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk
-
I think you can go for simple registry class known CRegKey defined in atlbase.h ----------------------------- "I Think It Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk
no it works wel, but not when i click the button. BOOL Cfirstw32mfcApp::InitInstance() { SetRegistryKey(_T("Natural_Demon")); .. .. } // this part works wel EDIT1 = AfxGetApp()->GetProfileString("Settings", "email", "your login"); EDIT2 = AfxGetApp()->GetProfileString("Settings", "password", "details here.."); UpdateData(FALSE); this part work wel also, i faild the retireve the data from the interface, although i use"UpdateData(FALSE);" i can paste it anywhere in the script, but if i use this "Cfirstw32mfcDlg::OnButtonOK()" HRESULT Cfirstw32mfcDlg::OnButtonOK(IHTMLElement* /*pElement*/) { UpdateData(FALSE); AfxGetApp()->WriteProfileString("Settings", "email", EDIT1); return FALSE; // return TRUE unless you set the focus to a control ... .. } it fails to retrieve the fresh data kind regards, marco