Articles and Tutorials

Upgrading Toolkit Standard to Toolkit Pro -Dock Window Creation

Author: Kirk StowellPlatform: Visual C++ MFC

You will also need to change you code to use the pro version toolbars.
As with the menubar, the toolbar object is usually created in CMainFrame::OnCreate
and enable docking is called to dock the toolbar to the applications work area.
The toolbar is created in a similar way to the menu bar with the addition of
loading the toolbar resource. You can define the title for your docking
pane by creating a string resource with the same id as the dock pane, for
example IDC_DOCKWINDOW. You can also call SetTitle as we have done here.

Setting the child window for the dock pane

To set the child window, in this case a tree control for the dock pane you
need to call CXTPDockingPane::Attach and pass in the pointer to the window that
want to be attached to the docking pane. The best place to do this is when
the dock pane is initially displayed. We can do this by using the
XTP_DPT_SHOWWINDOW notification message handler as shown here: