Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtToolControlBar problem - when pressing buttons, nothing happens (and one more issue) Collapse All
Subject Author Date
Maxim Maximov Apr 22, 2009 - 8:57 AM

Hello!


I just added  CExtToolControlBar to my app, here’s initialization:


 


VERIFY(
		g_CmdManager->ProfileSetup(
		theApp.m_pszProfileName,
		  GetSafeHwnd() // HWND of the frame window
		  )
		);

	VERIFY(
		g_CmdManager->UpdateFromToolBar(
		  theApp.m_pszProfileName,
		  IDR_MAINFRAME
		  )
		);

	VERIFY(
		g_CmdManager->UpdateFromMenu(
		  theApp.m_pszProfileName,
		  IDR_MAINFRAME)
		  );

	VERIFY(
		g_CmdManager->UpdateFromMenu(
		  theApp.m_pszProfileName,
		  IDR_ProfitRangerTYPE)
		  );


	if( !m_wndToolBar.Create(
		  _T( "Toolbar name" ),
		  this,
		  AFX_IDW_TOOLBAR
		)
		|| !m_wndToolBar.LoadToolBar( IDR_MAINFRAME )
		)
	{
		TRACE0( "Failed to create toolbar" );
		return -1;
	}


Toolbar is displayed, but when I press a button, nothing happens (menu works like a charm).


What is wrong?

Technical Support Apr 22, 2009 - 11:33 AM

First of all, please use the CExtControlBar::FrameEnableDocking() static method for enabling redockable bars in your main frame window instead of the MFC’s CFrameWnd::EnableDocking() method. This note is not related to the m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); line of code.
It would be helpful to take a look at entire CMainFrame::OnCreate() method in your project. We suspect the problem can be hidden somewhere else.