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. ReBars (urgent)

ReBars (urgent)

Scheduled Pinned Locked Moved C / C++ / MFC
helplearning
7 Posts 3 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.
  • S Offline
    S Offline
    Space Ace
    wrote on last edited by
    #1

    I've a ReBar in my SDI-Application and an Extended Combo Box in it. With the help of Class Wizard I select an existing class (CMainFrame) to be associated with the IDR_MAINFRAME resource of the rebar. In CMainFrame I create a OnSelChangeComboboxex1() function. It looks like this: CComboBoxEx *pCombo = (CComboBoxEx *)GetDlgItem(IDC_COMBOBOXEX1); int nSel = pCombo->GetCurSel(); etc. But the program fails because of some unhandled exception. I really don't know what the problem can be. Someone, please, help!

    T S 2 Replies Last reply
    0
    • S Space Ace

      I've a ReBar in my SDI-Application and an Extended Combo Box in it. With the help of Class Wizard I select an existing class (CMainFrame) to be associated with the IDR_MAINFRAME resource of the rebar. In CMainFrame I create a OnSelChangeComboboxex1() function. It looks like this: CComboBoxEx *pCombo = (CComboBoxEx *)GetDlgItem(IDC_COMBOBOXEX1); int nSel = pCombo->GetCurSel(); etc. But the program fails because of some unhandled exception. I really don't know what the problem can be. Someone, please, help!

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      If this is really urgent, why can't you provide more information on 'some unhandled exception'? Is your combo a child of mainframe, or rather it's located on rebar? Tomasz Sowinski -- http://www.shooltz.com

      What is "scratch" and why can everything be made from it?

      1 Reply Last reply
      0
      • S Space Ace

        I've a ReBar in my SDI-Application and an Extended Combo Box in it. With the help of Class Wizard I select an existing class (CMainFrame) to be associated with the IDR_MAINFRAME resource of the rebar. In CMainFrame I create a OnSelChangeComboboxex1() function. It looks like this: CComboBoxEx *pCombo = (CComboBoxEx *)GetDlgItem(IDC_COMBOBOXEX1); int nSel = pCombo->GetCurSel(); etc. But the program fails because of some unhandled exception. I really don't know what the problem can be. Someone, please, help!

        S Offline
        S Offline
        Shog9 0
        wrote on last edited by
        #3

        Even though CMainFrame may be getting messages sent by it, the combobox is not actually a direct child. So GetDlgItem() is returning NULL, hence your crash. You'll need to obtain a handle to the ReBar window (this should already be a member of CMainFrame) and use that to obtain the combobox handle.

        ---

        Shog9 If I could sleep forever, I could forget about everything...

        S 2 Replies Last reply
        0
        • S Shog9 0

          Even though CMainFrame may be getting messages sent by it, the combobox is not actually a direct child. So GetDlgItem() is returning NULL, hence your crash. You'll need to obtain a handle to the ReBar window (this should already be a member of CMainFrame) and use that to obtain the combobox handle.

          ---

          Shog9 If I could sleep forever, I could forget about everything...

          S Offline
          S Offline
          Space Ace
          wrote on last edited by
          #4

          Thanks, I've got your idea. But how exactly should I obtain a handle to the ReBar window? (sorry, I'm just a beginner)

          S 1 Reply Last reply
          0
          • S Shog9 0

            Even though CMainFrame may be getting messages sent by it, the combobox is not actually a direct child. So GetDlgItem() is returning NULL, hence your crash. You'll need to obtain a handle to the ReBar window (this should already be a member of CMainFrame) and use that to obtain the combobox handle.

            ---

            Shog9 If I could sleep forever, I could forget about everything...

            S Offline
            S Offline
            Space Ace
            wrote on last edited by
            #5

            Please, help!!

            1 Reply Last reply
            0
            • S Space Ace

              Thanks, I've got your idea. But how exactly should I obtain a handle to the ReBar window? (sorry, I'm just a beginner)

              S Offline
              S Offline
              Shog9 0
              wrote on last edited by
              #6

              It should be a member of your CMainFrame class. Probably it's called m_wndReBar. Note that the ReBar control itself only contains other windows, so it could contain the combo box itself, or the combo box could be on a dialog bar contained by the ReBar; i'm not sure how you set this up, so i can't say for sure. If you *are* using a dialog bar, there'll be another member of CMainFrame for that. Poke around a bit, it should all be clear.

              ---

              Shog9 If I could sleep forever, I could forget about everything...

              S 1 Reply Last reply
              0
              • S Shog9 0

                It should be a member of your CMainFrame class. Probably it's called m_wndReBar. Note that the ReBar control itself only contains other windows, so it could contain the combo box itself, or the combo box could be on a dialog bar contained by the ReBar; i'm not sure how you set this up, so i can't say for sure. If you *are* using a dialog bar, there'll be another member of CMainFrame for that. Poke around a bit, it should all be clear.

                ---

                Shog9 If I could sleep forever, I could forget about everything...

                S Offline
                S Offline
                Space Ace
                wrote on last edited by
                #7

                Oh yeah, thanks, that helped, it turned out to be m_wndDlgBar

                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