MFC DialogBar problem

Started by
1 comment, last by remi 19 years, 11 months ago
Hi all, I''ve have added a CDialogBar to my SDI window,but all the push button like controls are disabled,even if dynamically enable them(with the EnableWindow() function), they just remain disabled while all the other controls are working properly.

CFrameWnd *cFrame = NULL;
	cFrame = this->GetParentFrame();
	
	if(!m_GameDlgBar.Create(cFrame,
		IDD_GAME_DLG_BAR,
		WS_CHILD | WS_VISIBLE | CBRS_RIGHT		IDD_GAME_DLG_BAR))
	{
		AfxMessageBox( "Unable to create m_GameDlgBar\n"
			+GetErrorString());
		return ;//FALSE;

	};
	m_GameDlgBar.EnableButtons();
and then the function EnableButton''s def.

void CGameDlgBar::EnableButtons()
{
	
	HWND hWnd;
	GetDlgItem( IDC_PASS, &hWnd);
	::EnableWindow(hWnd, TRUE);
	GetDlgItem( IDC_SEND, &hWnd);
	::EnableWindow(hWnd, TRUE);
	//m_Send.EnableWindow( TRUE );

	//m_Pass.EnableWindow( TRUE );


}
Any help?
"...and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces."----------Scott Meyers, "Effective C++"
Advertisement
Hi,
I have the same problem, that the buttons on a dialogbar are disabled. Have you already found a solution?
I would appreciate an answer very much.
Yeah i solved the problem but i don''t remember exactly what i did. Try adding CBRS_TOOLTIPS | CBRS_FLYBY this flag to your CToolBar''s CreateEx function.

If it doesn''t work, post your code over.
"...and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces."----------Scott Meyers, "Effective C++"

This topic is closed to new replies.

Advertisement