VC++ 2008中的CDialogBar 该怎样使用?解决方案

VC++ 2008中的CDialogBar 该怎样使用?
我在网上找到一些资料,好像都是关于VC6.0的,因为在VS2008中 CDialogBar已经可以作为基类。
下面是在MainFrm中的代码
if (!m_DBar.Create(this, IDD_DIALOGBAR, CBRS_LEFT|CBRS_TOOLTIPS|CBRS_FLYBY, IDD_DIALOGBAR))
{
TRACE0("Failed to create DlgBar\n");
return -1; // Fail to create.
}
m_DBar.EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_DBar, AFX_IDW_DOCKBAR_LEFT);
每次问题都出在最后一行DockControlBar(&m_DBar, AFX_IDW_DOCKBAR_LEFT);

断点进入
void CFrameWnd::DockControlBar(CControlBar* pBar, UINT nDockBarID, LPCRECT lpRect)
{
CDockBar* pDockBar = (nDockBarID == 0) ? NULL :
(CDockBar*)GetControlBar(nDockBarID);
DockControlBar(pBar, pDockBar, lpRect);
}
不知道为什么pDockBar总是一个NULL值。
拜托大家了!

------解决方案--------------------
This is because your CMainFrame will be derived from CFrameWnd in the VS2003 project. Upgrading the project preserved the class derivation. Your new projects created with VS2008 are probably derived from CFrameWndEx which does not support docking a CDialogBar.

You will need to derive your CMainFrame from CFrameWnd if you want the old behavior.

类似的,我把CMDIChildWndEx 换回 CMDIChildWnd ,CDialogBar就可用了。