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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Help adding toolbar to a propertypage!

Help adding toolbar to a propertypage!

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelpquestionworkspace
1 Posts 1 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.
  • M Offline
    M Offline
    montiee
    wrote on last edited by
    #1

    Well I have a mini-project just for my own personal curiosity where I've setup a propertysheet and added a number of propertypages to it. So far so good, no issues. However on on of the propertypages I want to add a toolbar. Now there is quite a bit of info out there on toolbars but for the life of me I can't work out what I'm missing so I'm hoping one of you might point me to some source code where this is done or point out what I'm missing. Below is the code I added to add the toolbar to what I think should be the property page. int CClientMgrPage::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CPropertyPage::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here CFrameWnd *pFrameWnd=(CFrameWnd *)GetParent(); if (!m_CMgr_ToolBarCtrl.CreateEx(this, TBSTYLE_FLAT, WS_CHILD|WS_VISIBLE|CBRS_TOP) || !m_CMgr_ToolBarCtrl.LoadToolBar(IDR_Emgr_TOOLBAR)) { TRACE0("Failed to create Client Mgr Toolbar"); } m_CMgr_ToolBarCtrl.EnableDocking(CBRS_ALIGN_ANY); pFrameWnd->EnableDocking(CBRS_ALIGN_ANY); pFrameWnd->DockControlBar(&m_CMgr_ToolBarCtrl); return 0; } With this code in place I trigger an assertion when I click on the tab containing the Toolbar. CDockContext::CDockContext(CControlBar* pBar) { ASSERT(pBar != NULL); ASSERT(pBar->m_pDockSite != NULL); <------- } Any ideas?

    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