Thread: Control Array Value Retrieval

  1. #1
    Registered User
    Join Date
    Aug 2013
    Posts
    2

    Control Array Value Retrieval

    Hello,

    I am using MFC (and a newbie here) and I want to retrieve values of my control array.

    How can I possibly do that?

    This is my ControlArray

    Code:
    m_EditArray[0]=GetDlgItem(IDC_EDIT1);
    m_EditArray[1]=GetDlgItem(IDC_EDIT2);
    m_EditArray[2]=GetDlgItem(IDC_EDIT3);
    m_EditArray[3]=GetDlgItem(IDC_EDIT4);
    m_EditArray[4]=GetDlgItem(IDC_EDIT5);
    m_EditArray[5]=GetDlgItem(IDC_EDIT6);

  2. #2
    Registered User antred's Avatar
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    257
    Quote Originally Posted by bearhuggs8 View Post
    I am using MFC
    Oh God! Why, oh why??? Are you aware there are MUCH SUPERIOR alternatives? -> Qt Project

    Quote Originally Posted by bearhuggs8 View Post
    I want to retrieve values of my control array.

    How can I possibly do that?
    Not sure I understand the question, but how about this?

    Code:
    CWnd* oneItem = m_EditArray[0];
    CWnd* anotherItem = m_EditArray[1];

  3. #3
    Registered User
    Join Date
    Aug 2013
    Posts
    2
    Quote Originally Posted by antred View Post
    Oh God! Why, oh why??? Are you aware there are MUCH SUPERIOR alternatives? -> Qt Project

    - Why am I using MFC?
    I don't even want to but its what our client wants

    _________________________________________

    A friend told me about this code. But there should be a loop that retrieves the value. And that, I don't know yet.

    And there's this link which shows retrieval of values from a check box, but don't know how it works.
    Control arrays possible in C++?

    Code:
    CString m_EditValue[6];
    m_EditArray[i]->GetWindowTextA(m_EditValue[i]);
    Just sharing though

    And thanks for your kind answer and for the link. I'll be checking that after I'm done with this "i-really-can't-understand" project

    Last edited by bearhuggs8; 08-23-2013 at 03:42 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Password retrieval
    By jeromey55 in forum C++ Programming
    Replies: 6
    Last Post: 02-14-2011, 06:33 PM
  2. Help with linked list retrieval
    By Sly in forum C Programming
    Replies: 6
    Last Post: 01-15-2009, 07:11 PM
  3. WinInet - file size retrieval is not working too hot
    By blainemono in forum Windows Programming
    Replies: 2
    Last Post: 08-17-2007, 01:27 PM
  4. stock quote retrieval via yahoo finance
    By p_tyo in forum C++ Programming
    Replies: 17
    Last Post: 01-22-2007, 11:02 PM
  5. Control array
    By pug in forum C# Programming
    Replies: 3
    Last Post: 05-13-2005, 11:41 PM

Tags for this Thread