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. Problem with Visual studio 2008 feature pack's CMFCToolBar - not being displayed

Problem with Visual studio 2008 feature pack's CMFCToolBar - not being displayed

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestioncsharpc++visual-studio
2 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.
  • S Offline
    S Offline
    Sternocera
    wrote on last edited by
    #1

    Hello, I'm upgrading my MFC application to make use of some of the new user interface elements from the Visual studio 2008 feature pack. My first concern is upgrading my CToolBar to the pack's new CMFCToolBar, to use large icons, rollover buttons, etc. I use much the same boilerplate code in CMainFrame::OnCreate() as ever:

    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
    return -1;

    // I've attempted to simplify the code to the greatest possible extent to isolate the problem:

    // The this pointer points to CMainFrame class which extends the CFrameWnd class.
    if (!m_wndToolBar.CreateEx (this, TBSTYLE_TRANSPARENT) ||
    !m_wndToolBar.LoadToolBar (IDR_MAINFRAME))
    {
    TRACE0("Failed to create toolbar\n");
    return -1; // fail to create
    }

    However, no toolbar is visible when the application starts - it is simply omitted. Switching the class of m_wndToolBar from CMFCToolBar back to CToolBar once again makes the toolbar visible. Why might the framework fail to display my CMFCToolBar? How can I fix the problem? Regards, Sternocera

    P 1 Reply Last reply
    0
    • S Sternocera

      Hello, I'm upgrading my MFC application to make use of some of the new user interface elements from the Visual studio 2008 feature pack. My first concern is upgrading my CToolBar to the pack's new CMFCToolBar, to use large icons, rollover buttons, etc. I use much the same boilerplate code in CMainFrame::OnCreate() as ever:

      if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
      return -1;

      // I've attempted to simplify the code to the greatest possible extent to isolate the problem:

      // The this pointer points to CMainFrame class which extends the CFrameWnd class.
      if (!m_wndToolBar.CreateEx (this, TBSTYLE_TRANSPARENT) ||
      !m_wndToolBar.LoadToolBar (IDR_MAINFRAME))
      {
      TRACE0("Failed to create toolbar\n");
      return -1; // fail to create
      }

      However, no toolbar is visible when the application starts - it is simply omitted. Switching the class of m_wndToolBar from CMFCToolBar back to CToolBar once again makes the toolbar visible. Why might the framework fail to display my CMFCToolBar? How can I fix the problem? Regards, Sternocera

      P Offline
      P Offline
      Prasann Mayekar
      wrote on last edited by
      #2

      this new feature pack stores the settings under the registry, so delete the workspace registry key under ur app key and try. alternatively in initinstance() u can call cleanState(). if this doesnt work then try creating a new sample toolbar and check if it works. enjoy Pras

      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