如何创建CDialogBar工具栏???
Example
// Mainfrm.h.
class CMainFrame : public CFrameWnd
{
// Constructor.
public:
CMainFrame();
virtual ~CMainFrame();
protected: // Control bar embedded members.
CDialogBar m_wndDlgBar;
// Other data members and methods.
DECLARE_MESSAGE_MAP()
};
// Mainfrm.cpp.
#include "MainFrm.h"
/////////////////////////////////////////////////////
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
EnableDocking(CBRS_ALIGN_ANY);
// IDD_VIEWSELECT - Resource ID of the dialog
// template. This dialog template should be created
// with the style WS_CHILD and no other style.
// The template must not have the style WS_VISIBLE.
if (!m_wndDlgBar.Create(this, IDD_VIEWSELECT,
CBRS_LEFT|CBRS_TOOLTIPS|CBRS_FLYBY, IDD_VIEWSELECT))
{
TRACE0("Failed to create DlgBar\n");
return -1; // Fail to create.
}
return 0;
}
如此创建为何一运行就出错???