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. CListCtrl and CTabCtrl help required

CListCtrl and CTabCtrl help required

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorial
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.
  • R Offline
    R Offline
    Richard Lewis
    wrote on last edited by
    #1

    I have compiled a MFC dialog-based application. The GUI is organizedas follows: The application window is dialog-based and has the following on it: 1) Main dialog window has on it i)CListCtrl-1, ii)CTabCtrl-1 2) CTabCtrl-1 has on it 2 property pages. One of the property pages has a CListCtrl-2. (The other property page is irrelevant here) At the GUI-level, I want to achieve the following: "When an item in CListCtrl-1 is selected, the CListCtrl-2 should get populated with some values" What I am unable to do: I have added a message handler for CListCtrl-1 on the NM_CLICK event, but don't know how to get a pointer to CListCtrl-2 from the Main Dialog. I have sufficient experience with VC++ - any help even outlining a technique of doing this (although code is always welcome) will be highly appreciated. Thank you very much for the time you will taking out to help me on this.

    T 1 Reply Last reply
    0
    • R Richard Lewis

      I have compiled a MFC dialog-based application. The GUI is organizedas follows: The application window is dialog-based and has the following on it: 1) Main dialog window has on it i)CListCtrl-1, ii)CTabCtrl-1 2) CTabCtrl-1 has on it 2 property pages. One of the property pages has a CListCtrl-2. (The other property page is irrelevant here) At the GUI-level, I want to achieve the following: "When an item in CListCtrl-1 is selected, the CListCtrl-2 should get populated with some values" What I am unable to do: I have added a message handler for CListCtrl-1 on the NM_CLICK event, but don't know how to get a pointer to CListCtrl-2 from the Main Dialog. I have sufficient experience with VC++ - any help even outlining a technique of doing this (although code is always welcome) will be highly appreciated. Thank you very much for the time you will taking out to help me on this.

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

      is GetDlgItem() of any help ?


      TOXCCT >>> GEII power
      [toxcct][VisualCalc]

      R 1 Reply Last reply
      0
      • T toxcct

        is GetDlgItem() of any help ?


        TOXCCT >>> GEII power
        [toxcct][VisualCalc]

        R Offline
        R Offline
        Richard Lewis
        wrote on last edited by
        #3

        Thanks for the reply. GetDlgItem is not of any help, directly, but yes it has some role to play. Meanwhile, I have worked out the solution and it seems to work well. Here's what I did: a) I am persisting the pointers to all dialogs that the TabCtrl-1 will hold. (Simply putting them in a "CDialog *m_tabPages[4];" variable) b) Now I am simply doing the following CListCtrl * ptrToCListCtrl-2=(CListCtrl * )(TabCtrl.m_tabPages[0]->GetDlgItem(CListCtrl-2)); Thanks for the initiative, once again.

        T 1 Reply Last reply
        0
        • R Richard Lewis

          Thanks for the reply. GetDlgItem is not of any help, directly, but yes it has some role to play. Meanwhile, I have worked out the solution and it seems to work well. Here's what I did: a) I am persisting the pointers to all dialogs that the TabCtrl-1 will hold. (Simply putting them in a "CDialog *m_tabPages[4];" variable) b) Now I am simply doing the following CListCtrl * ptrToCListCtrl-2=(CListCtrl * )(TabCtrl.m_tabPages[0]->GetDlgItem(CListCtrl-2)); Thanks for the initiative, once again.

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          richiehere wrote: CListCtrl * ptrToCListCtrl-2=(CListCtrl * )(TabCtrl.m_tabPages[0]->GetDlgItem(CListCtrl-2)); ptrToCListCtrl-2???? what is this supposed to be ?


          TOXCCT >>> GEII power
          [toxcct][VisualCalc]

          R 1 Reply Last reply
          0
          • T toxcct

            richiehere wrote: CListCtrl * ptrToCListCtrl-2=(CListCtrl * )(TabCtrl.m_tabPages[0]->GetDlgItem(CListCtrl-2)); ptrToCListCtrl-2???? what is this supposed to be ?


            TOXCCT >>> GEII power
            [toxcct][VisualCalc]

            R Offline
            R Offline
            Richard Lewis
            wrote on last edited by
            #5

            Apologies for the confusion. I meant "pointer to the 2nd list control"!

            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