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. interesting problem

interesting problem

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutorial
6 Posts 5 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
    Sunnygirl
    wrote on last edited by
    #1

    hello @all, i have a dialogbased program. there a two buttons (eg. button1 and button2). if i press button1 first i get a new dialog (ID_DIALOG_COMBO) with a combobox (m_ctrlComboBox). if i press the button2 a CString (CString mystring) should be enterd into the combobox from the ID_DIALOG_COMBO. how can i do this???? thank you very much this is only an example, to explain the real background would be take to much time sunny

    C Z K A 4 Replies Last reply
    0
    • S Sunnygirl

      hello @all, i have a dialogbased program. there a two buttons (eg. button1 and button2). if i press button1 first i get a new dialog (ID_DIALOG_COMBO) with a combobox (m_ctrlComboBox). if i press the button2 a CString (CString mystring) should be enterd into the combobox from the ID_DIALOG_COMBO. how can i do this???? thank you very much this is only an example, to explain the real background would be take to much time sunny

      C Offline
      C Offline
      Colin Urquhart
      wrote on last edited by
      #2

      Looks like you need a modeless dialog. Take a look at Nish's tutorial.. http://www.codeproject.com/dialog/gettingmodeless.asp[^]

      1 Reply Last reply
      0
      • S Sunnygirl

        hello @all, i have a dialogbased program. there a two buttons (eg. button1 and button2). if i press button1 first i get a new dialog (ID_DIALOG_COMBO) with a combobox (m_ctrlComboBox). if i press the button2 a CString (CString mystring) should be enterd into the combobox from the ID_DIALOG_COMBO. how can i do this???? thank you very much this is only an example, to explain the real background would be take to much time sunny

        Z Offline
        Z Offline
        zarzor
        wrote on last edited by
        #3

        "Think about what you want the program to do. How would you do it manually ?" Christian Graus- Dec 02 :rolleyes: ZARZOR13

        1 Reply Last reply
        0
        • S Sunnygirl

          hello @all, i have a dialogbased program. there a two buttons (eg. button1 and button2). if i press button1 first i get a new dialog (ID_DIALOG_COMBO) with a combobox (m_ctrlComboBox). if i press the button2 a CString (CString mystring) should be enterd into the combobox from the ID_DIALOG_COMBO. how can i do this???? thank you very much this is only an example, to explain the real background would be take to much time sunny

          K Offline
          K Offline
          kjessee
          wrote on last edited by
          #4

          Put button 2 on ID_DIALOG_COMBO Kevin

          S 1 Reply Last reply
          0
          • S Sunnygirl

            hello @all, i have a dialogbased program. there a two buttons (eg. button1 and button2). if i press button1 first i get a new dialog (ID_DIALOG_COMBO) with a combobox (m_ctrlComboBox). if i press the button2 a CString (CString mystring) should be enterd into the combobox from the ID_DIALOG_COMBO. how can i do this???? thank you very much this is only an example, to explain the real background would be take to much time sunny

            A Offline
            A Offline
            Anonymous
            wrote on last edited by
            #5

            I would create the dialog in a thread, use a CStringArray for the contents of the combo box and create a function to refresh the combo. _beginthread( ShowDialog, 0, ID_DIALOG_COMBO ); LRESULT ShowDialog( LPVOID pVoid ) { CDialog Dlg; Dlg.Create( pVoid ); Dlg.DoModal(); return TRUE; } or CMyDialog* pDlg = new CMyDialog; pDlg->... // initialize members _beginthread( ShowDialog, 0, (void*)pDlg ); LRESULT ShowDialog( LPVOID pVoid ) { CDialog* pDlg = (CDialog*)pVoid ; pDlg->DoModal(); delete pDlg; return TRUE; } The pointer method is preferable because you can store the pointer(s) and control the dialog using these pointers. Make a function to refresh your combo and call it through any initialized pointers. Maybe use a CPtrArray.

            1 Reply Last reply
            0
            • K kjessee

              Put button 2 on ID_DIALOG_COMBO Kevin

              S Offline
              S Offline
              Sunnygirl
              wrote on last edited by
              #6

              i would be happy if i could do this, but the real program is more complicated... i must have to different buttons, because if you have not a right password (somewhere before) you cannot see the ID_DIALOG_COMBO thanks sunny

              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