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. CMFCToolBarComboBoxButton dont work on some machines

CMFCToolBarComboBoxButton dont work on some machines

Scheduled Pinned Locked Moved C / C++ / MFC
testingbeta-testingtutorial
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.
  • V Offline
    V Offline
    vojtee
    wrote on last edited by
    #1

    Hi i created a Combobox Button in toolbar. It working fine in my machine. But when i testing it on other machines not all but some with win 10 and 7. It case to stop running application.

    ON_REGISTERED_MESSAGE(AFX_WM_RESETTOOLBAR, OnToolbarReset)

    LRESULT CMainFrame::OnToolbarReset(WPARAM wp, LPARAM)
    {
    UINT uiToolBarId = (UINT)wp;

    switch (uiToolBarId)
    {
    
    case IDR\_MAINFRAME:
    case IDR\_MAINFRAME\_256:
    {
    

    CMFCToolBarComboBoxButton comboButton(ID_COMBO, GetCmdMgr()->GetCmdImage(ID_COMBO, FALSE), CBS_DROPDOWNLIST);
    comboButton.AddItem(_T("opt 1"));
    comboButton.AddItem(_T("opt 2"));
    comboButton.AddItem(_T("opt 3"));

    comboButton.SelectItem(0);
    m_wndToolBar.ReplaceButton(ID_COMBO, comboButton);

    }
    break;
    }
    return 0;
    

    }

    Im out of ideas How to make it working.

    L _ 2 Replies Last reply
    0
    • V vojtee

      Hi i created a Combobox Button in toolbar. It working fine in my machine. But when i testing it on other machines not all but some with win 10 and 7. It case to stop running application.

      ON_REGISTERED_MESSAGE(AFX_WM_RESETTOOLBAR, OnToolbarReset)

      LRESULT CMainFrame::OnToolbarReset(WPARAM wp, LPARAM)
      {
      UINT uiToolBarId = (UINT)wp;

      switch (uiToolBarId)
      {
      
      case IDR\_MAINFRAME:
      case IDR\_MAINFRAME\_256:
      {
      

      CMFCToolBarComboBoxButton comboButton(ID_COMBO, GetCmdMgr()->GetCmdImage(ID_COMBO, FALSE), CBS_DROPDOWNLIST);
      comboButton.AddItem(_T("opt 1"));
      comboButton.AddItem(_T("opt 2"));
      comboButton.AddItem(_T("opt 3"));

      comboButton.SelectItem(0);
      m_wndToolBar.ReplaceButton(ID_COMBO, comboButton);

      }
      break;
      }
      return 0;
      

      }

      Im out of ideas How to make it working.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      vojtee wrote:

      How to make it working.

      The first thing you need to do is to find out why it is "not working", and explain exactly what "not working" means. Without that information it is impossible to help.

      V 1 Reply Last reply
      0
      • L Lost User

        vojtee wrote:

        How to make it working.

        The first thing you need to do is to find out why it is "not working", and explain exactly what "not working" means. Without that information it is impossible to help.

        V Offline
        V Offline
        vojtee
        wrote on last edited by
        #3

        I cant describe it better than not working :). So i have 2 application. In first app that code is included and in second app that code is not included. First application don't work on some machines but on thers works fine. Windows do not generate any error. It just start and close immediately. Second app working fine everywhere.

        L 1 Reply Last reply
        0
        • V vojtee

          I cant describe it better than not working :). So i have 2 application. In first app that code is included and in second app that code is not included. First application don't work on some machines but on thers works fine. Windows do not generate any error. It just start and close immediately. Second app working fine everywhere.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Well I am sorry but it is impossible to guess what your code is doing. You have the source code so you need to add some debugging to your program to find out where it is going wrong.

          1 Reply Last reply
          0
          • V vojtee

            Hi i created a Combobox Button in toolbar. It working fine in my machine. But when i testing it on other machines not all but some with win 10 and 7. It case to stop running application.

            ON_REGISTERED_MESSAGE(AFX_WM_RESETTOOLBAR, OnToolbarReset)

            LRESULT CMainFrame::OnToolbarReset(WPARAM wp, LPARAM)
            {
            UINT uiToolBarId = (UINT)wp;

            switch (uiToolBarId)
            {
            
            case IDR\_MAINFRAME:
            case IDR\_MAINFRAME\_256:
            {
            

            CMFCToolBarComboBoxButton comboButton(ID_COMBO, GetCmdMgr()->GetCmdImage(ID_COMBO, FALSE), CBS_DROPDOWNLIST);
            comboButton.AddItem(_T("opt 1"));
            comboButton.AddItem(_T("opt 2"));
            comboButton.AddItem(_T("opt 3"));

            comboButton.SelectItem(0);
            m_wndToolBar.ReplaceButton(ID_COMBO, comboButton);

            }
            break;
            }
            return 0;
            

            }

            Im out of ideas How to make it working.

            _ Offline
            _ Offline
            _Flaviu
            wrote on last edited by
            #5

            Put some traces inside your code, so you can know what is going wrong at some PC.

            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