Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

How to get message OnUpdateCommandUI from CMFCRibbonBar at DLL

$
0
0

Hi.
 
I have an SDI application (EXE), with its RIBBON. This application have plugins as DLL.
 
In these plugins I have created an CFrameWnd, with another CMFCRibbonBar...
 
My problem is... I dont get receive OnUpdateCommandUI from DLL CMFCRibbonBar. Only when I have clicked in any button.
 
Normally, when I have "OnHover" this send an OnUpdateCommandUI to control... In my DLL this doesnt happened.
 
This is my code, OnUpdateBtnNew is called only when I have clicked on ID_BTN_NEW button:

void CMTFrameWnd::CreateRibbon() 
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	m_wndRibbonBar.Create(this);
	MT_PUSH_RESOURCE("MTBaseRes.dll");
	m_wndRibbonBar.LoadFromResource(IDR_RIBBON_CADASTROS);
	if (!m_wndStatusBar.Create(this))
	{
		TRACE0("Failed to create status bar\n");
		return;      // fail to create
	}
}
BEGIN_MESSAGE_MAP(CMTFrameWnd, CFrameWndEx)
	ON_WM_CREATE()
	ON_WM_CLOSE()
	ON_COMMAND(ID_BTN_EXIT, &CMTFrameWnd::OnBtnExit)
	ON_COMMAND(ID_BTN_NEW, &CMTFrameWnd::OnBtnNew)
	ON_UPDATE_COMMAND_UI(ID_BTN_NEW, &CMTFrameWnd::OnUpdateBtnNew)
	ON_COMMAND(ID_BTN_DEL, &CMTFrameWnd::OnBtnDel)
	ON_UPDATE_COMMAND_UI(ID_BTN_DEL, &CMTFrameWnd::OnUpdateBtnDel)
END_MESSAGE_MAP()

Source code example.
https://docs.google.com/file/d/0B8B-NIoST12WeWE3cm9YdmFMRG8/edit?usp=sharing[^]


VC++ Programmer


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>