MFC Feature Pack 2008 CPaneDialog as CDialogBar

1.5k views Asked by At

I am writing software with MFC feature pack 2008. My application is based on old version this application. The old version was not written with feature pack. In the old version of this application, there are CToolBar and 3 CDialogBars. It looks as follow: enter image description here

In my application, I changed CToolBar to CMFCToolbar and CDialogBars to CPaneDialogs. I don't know how I can set CPaneDialogs to make the same visual effect like in the old application? How can I dock CPaneDialogs to left of CMFCToolbar?

to sum up, what I did:

1) Create CPaneDialogs this way:

    if (!m_LoadDlgBar.Create(_T("DialogBar"),this, 0,IDD_REGBAR,CBRS_TOP | CBRS_FLYBY |CBRS_GRIPPER|  WS_CLIPCHILDREN,IDD_REGBAR))
    {
       TRACE0("Failed to create dialog bar\n");
       return -1;      // fail to create
    }

2) Docking:

EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_CommBar);          // this is CMFCToolbar
DockPaneLeftOf(&m_LoadDlgBar, &m_CommBar);    
DockPaneLeftOf(&m_TCPIPDlgBar, &m_LoadDlgBar);    
DockPaneLeftOf(&m_ConnDlgBar, &m_TCPIPDlgBar);    

3) Show the Pane:

m_LoadDlgBar.ShowPane(TRUE,FALSE,FALSE);

And this is result:

enter image description here

All of CPaneDialogs are dock in the same place, on the CMFCToolbar.

1

There are 1 answers

4
xMRi On

You initiate docking with DockPane, so instead of using CFrameWndEx::DockPane use CFrameWndEx::DockPaneLeftOf

PS: This article provides a little help, but saddly it just scratches the surface.