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. Switch case in MFC

Switch case in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
5 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.
  • U Offline
    U Offline
    User 1607091
    wrote on last edited by
    #1

    How to perform switch case in MFC (Not in dialog form)????

    T D 2 Replies Last reply
    0
    • U User 1607091

      How to perform switch case in MFC (Not in dialog form)????

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

      i'm quite sure you are not familiar with C++. switch statements are C++ statements, so, any libraries like MLC (Microsoft), OWL (Borland) or any other understand switchs the same way... the switch is a sort of if / else if /else statement... so what is your question exactly ?


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

      U 1 Reply Last reply
      0
      • T toxcct

        i'm quite sure you are not familiar with C++. switch statements are C++ statements, so, any libraries like MLC (Microsoft), OWL (Borland) or any other understand switchs the same way... the switch is a sort of if / else if /else statement... so what is your question exactly ?


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

        U Offline
        U Offline
        User 1607091
        wrote on last edited by
        #3

        void CLawMaterialView::OnSelchangeType() { m_combo=(CComboBox *)GetDlgItem(IDC_TYPE); m_eFruitVal = (eEnumeratedFruit)m_combo->GetCurSel(); switch (m_eFruitVal) { case 1:eRD; m_combo1=(CComboBox *)GetDlgItem(IDC_COMBO2); m_combo1->SetCurSel(0); m_combo1->ResetContent(); m_combo1->AddString("White ceramic rod BA80");// I want it from databse NOT add one by one. } From above code, is it Add a new value after select the 1st combobox, BUT how to have a value in combobox is from database???? Plz advise! Danny Gan

        T 1 Reply Last reply
        0
        • U User 1607091

          void CLawMaterialView::OnSelchangeType() { m_combo=(CComboBox *)GetDlgItem(IDC_TYPE); m_eFruitVal = (eEnumeratedFruit)m_combo->GetCurSel(); switch (m_eFruitVal) { case 1:eRD; m_combo1=(CComboBox *)GetDlgItem(IDC_COMBO2); m_combo1->SetCurSel(0); m_combo1->ResetContent(); m_combo1->AddString("White ceramic rod BA80");// I want it from databse NOT add one by one. } From above code, is it Add a new value after select the 1st combobox, BUT how to have a value in combobox is from database???? Plz advise! Danny Gan

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

          sorry but... i don't understand you question...:~ :confused::doh: could you please reformulate much explicitely ?


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

          1 Reply Last reply
          0
          • U User 1607091

            How to perform switch case in MFC (Not in dialog form)????

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            The switch statement has nothing to do with MFC. It is a C construct.


            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            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