Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MFC VC10.0
Hi guys, now am in a MFC project which contains rich ribbon controls.
I am using document view architecture and i inherit my view class from CListView.
In my UI design i have 6 category ribbons, i need to change my list view when category ribbons are selected.
 
Is there any notification is for category selection change. i dont know how to do it and also i need to do command routing from my CMainFrame to CDocView. How can achieve these two.......
 
If you know guide me.....
 
Thanks in advance
ganesh_IT
Posted 10-Mar-11 0:51am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi,
I'm sure this is outdated question, but here's the straight answer.
Add this to you message map in MainFrm.cpp:
ON_REGISTERED_MESSAGE(AFX_WM_ON_CHANGE_RIBBON_CATEGORY, OnRibbonCategoryChanged)
then, declare and implement method OnRibbonCategoryChanged:
LPARAM CMainFrame::OnRibbonCategoryChanged(WPARAM wp, LPARAM lp)
{
	CMFCRibbonCategory *pCategory=m_wndRibbonBar.GetActiveCategory();
	int nCategory=m_wndRibbonBar.GetCategoryIndex(pCategory);
	//... do something
	return 0;
}
 
The nCategory variable holds current category index (starting with one, left to right).
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi guys, i found solution for my problem. There is r registered message AFX_WM_ON_CHANGE_RIBBON_CATEGORY.
 
MFC Frame work send this message to the framewnd when category is changed. It LPARAM contains pointer to the CMFCRibbonBar using this we can get our active category name.
 
Thanks
ganeshIT
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Thanks for your good question and answer!
I really need this information because i have been looking for this message!
 
Kind regards,
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 150
2 PIEBALDconsult 110
3 Richard MacCutchan 105
4 Sergey Alexandrovich Kryukov 104
0 OriginalGriff 6,055
1 DamithSL 4,621
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,500
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 14 Apr 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100