After struggling with getting CDialogBar in the app, the buttons were permanently greyed out. I also wanted to change the button text. The information here helped immensely, but it took me awhile to get it working.
I thought it would be a nice gesture to post my code, which incorporates the greyed-out button problem fix, the error in the posted code, and the interfacing with ClassWizard in VC++6.
Your override of the Create function has a bug which
results in OnInitDialogBar being called twice, see below.
Otherwise this is a great idea which i have found very
BOOL CInitDialogBar::Create(CWnd * pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID)
// Calling the overridden Create will result in
// OnInitDialogBar being called twice. Instead call
// the base class version.
// if(!Create(pParentWnd, MAKEINTRESOURCE(nIDTemplate), nStyle, nID))
// return FALSE;
if(!CDialogBar::Create(pParentWnd, MAKEINTRESOURCE(nIDTemplate), nStyle, nID))