Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. it fails to retrieve newly intruduced data by the user

it fails to retrieve newly intruduced data by the user

Scheduled Pinned Locked Moved C / C++ / MFC
c++windows-adminalgorithmsdebuggingannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Natural_Demon
    wrote on last edited by
    #1

    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

    T 1 Reply Last reply
    0
    • N Natural_Demon

      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

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      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

      N 1 Reply Last reply
      0
      • T ThatsAlok

        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

        N Offline
        N Offline
        Natural_Demon
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups