In one of our applications I've used some of the MFC classes to allow docking a sidebar window, approximately like so:
CDialogBar* bar = new CDialogBar;
bar->Create(this, IDD, WS_CHILD | WS_VISIBLE | CBRS_RIGHT | CBRS_TOOLTIPS, IDD));
bar->EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_RIGHT | CBRS_ALIGN_LEFT);
DockControlBar(bar, AFX_IDW_DOCKBAR_RIGHT);
This all works fine.
I want to do a similar thing now in another application. Unfortunately it has been changed to use some classes from the MFC "feature pack", which are very pretty but this approach no longer works (it asserts, which I can fix with some minor modification but then the sidebar doesn't appear). The documentation for these new classes is woeful, so I'm having quite a bit of trouble figuring out what I'm supposed to do. I've tried what seems to be the "new" approach:
CPaneDialog* pane = new CPaneDialog;
pane->Create("pane", this, TRUE, IDD, WS_VISIBLE | WS_CHILD, IDD);
EnableDocking(CBRS_ALIGN_RIGHT | CBRS_ALIGN_LEFT);
AddPane(pane);
DockPane(pane);
This works in that a sidebar window appears, but it doesn't seem to be movable and isn't getting drawn properly.
I feel like I'm shooting in the dark with all this. Does anybody know what the right approach to it is?