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. to create CDialog with completed forms

to create CDialog with completed forms

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
5 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
    NoName II
    wrote on last edited by
    #1

    I'd like to create dialog box with completed fields... write smth like this class CDlg:public CDialog{ public: CDlg(UINT nRes, CWnd *pParent,int nIndx=-1); DECLARE_MESSAGE_MAP() afx_msg void OnOk(); }; CDlg::CDlg(UINT nRes, CWnd *pParent, int nIndx) : CDialog(nRes, pParent) { if(nIndx!=-1){ CPerson* pers=(CPerson*)ob_arr[nIndx]; AfxMessageBox(pers->GetName());//check is there access to CPerson's functions ... it's OK SetDlgItemText (IDC_EDIT2,_T("1111111")/*pers->GetName()*/);//error in winocc.cpp line:156 } }

    N 1 Reply Last reply
    0
    • N NoName II

      I'd like to create dialog box with completed fields... write smth like this class CDlg:public CDialog{ public: CDlg(UINT nRes, CWnd *pParent,int nIndx=-1); DECLARE_MESSAGE_MAP() afx_msg void OnOk(); }; CDlg::CDlg(UINT nRes, CWnd *pParent, int nIndx) : CDialog(nRes, pParent) { if(nIndx!=-1){ CPerson* pers=(CPerson*)ob_arr[nIndx]; AfxMessageBox(pers->GetName());//check is there access to CPerson's functions ... it's OK SetDlgItemText (IDC_EDIT2,_T("1111111")/*pers->GetName()*/);//error in winocc.cpp line:156 } }

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      NoName II wrote:

      CDlg::CDlg(UINT nRes, CWnd *pParent, int nIndx) : CDialog(nRes, pParent) { if(nIndx!=-1){ CPerson* pers=(CPerson*)ob_arr[nIndx]; AfxMessageBox(pers->GetName());//check is there access to CPerson's functions ... it's OK SetDlgItemText (IDC_EDIT2,_T("1111111")/*pers->GetName()*/);//error in winocc.cpp line:156 }

      Do the initialization part in OnInitDialog. Do not do this in the construtor.


      Nibu thomas Software Developer CPP Faqs by Michael dunn

      N 1 Reply Last reply
      0
      • N Nibu babu thomas

        NoName II wrote:

        CDlg::CDlg(UINT nRes, CWnd *pParent, int nIndx) : CDialog(nRes, pParent) { if(nIndx!=-1){ CPerson* pers=(CPerson*)ob_arr[nIndx]; AfxMessageBox(pers->GetName());//check is there access to CPerson's functions ... it's OK SetDlgItemText (IDC_EDIT2,_T("1111111")/*pers->GetName()*/);//error in winocc.cpp line:156 }

        Do the initialization part in OnInitDialog. Do not do this in the construtor.


        Nibu thomas Software Developer CPP Faqs by Michael dunn

        N Offline
        N Offline
        NoName II
        wrote on last edited by
        #3

        how can I send nIndx in OnInitDialog?

        N 1 Reply Last reply
        0
        • N NoName II

          how can I send nIndx in OnInitDialog?

          N Offline
          N Offline
          Nibu babu thomas
          wrote on last edited by
          #4

          Use an Init function for these kind of initialization purposes.

          NoName II wrote:

          how can I send nIndx in OnInitDialog?

          Store the nIndx as a member variable or store the person object as a member variable of the dialog class.


          Nibu thomas Software Developer Faqs by Michael dunn

          N 1 Reply Last reply
          0
          • N Nibu babu thomas

            Use an Init function for these kind of initialization purposes.

            NoName II wrote:

            how can I send nIndx in OnInitDialog?

            Store the nIndx as a member variable or store the person object as a member variable of the dialog class.


            Nibu thomas Software Developer Faqs by Michael dunn

            N Offline
            N Offline
            NoName II
            wrote on last edited by
            #5

            Thanks

            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