Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:

C++
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[^]
Posted
Updated 15-Jul-13 9:06am
v6
Comments
Richard MacCutchan 9-Jul-13 16:37pm    
Who is this message directed to? If this is in response to a CodeProject article then use the forum at the end of the article to contact the author.
Omar.Pessoa 11-Jul-13 8:02am    
Hi Richard, this is not a response to a CodeProject article, this is a question from my current "problem".
Richard MacCutchan 11-Jul-13 8:39am    
Your question says: "I have an SDI application (EXE), with your RIBBON.". So whose ribbon are you talking about?
Omar.Pessoa 11-Jul-13 16:19pm    
Sorry! :P "with its RIBBON"
Richard MacCutchan 12-Jul-13 2:53am    
The problem is probably because you have multiple frame windows and all messages are directed to the one that is currently top of the z-order. The DLL frame will only be in this state after you have clicked into it so it gets focus.

contact the authot of the dll.
 
Share this answer
 
Comments
Omar.Pessoa 12-Jul-13 10:27am    
KastenK the DLL is mine.
KarstenK 15-Jul-13 2:09am    
you should forward the message in the dll in the message handler of OnUpdateCommandUI to the parent (exe)
This is the solution!

The solution I picked was to add a timer to my CFrame window. When the timer occurs, I simply called CWndApp::OnIdle(0).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900