Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi!
Here's the plot: I have a project with a standard layout - toolbars etc. I've been asked to change the layout to ribbon. Creating a new project doesn't seem to be an option, at least for now. Is it possible and how?
Thanks in advance!
Posted

Sure it's possible, you'll likely end up knowing a lot more about both your application and the MFC framework then you'll ever want to know though. All of the objects you see in an MFC application are added by wizards onto the SDI/MDI application (wherever they're appropriate), which means, you can remove them by commenting or simply deleting those sections. By the same token, the ribbon is just an addition to an SDI/MDI application, so you can add all those things the wizards usually do by hand.

If you've ever had to alter toolbars, you'll realize all the pieces are there and you just have to learn how to deal with them. Same thing with the ribbon.
 
Share this answer
 
Comments
StoyanovZ 15-Nov-13 12:03pm    
Yup, yesterday I found a tutorial on blending both styles. It seems to be quite easy but now I don't have access to a computer with VS to test :( I'll have to wait untill Monday.
Albert Holguin 15-Nov-13 12:47pm    
I'd say download VS Express... but I'm pretty sure the free version doesn't have MFC.
StoyanovZ 15-Nov-13 14:42pm    
All stuff must be done in VS 2010. That's the IDE used till now and mustn't be changed. May be I'm not looking at the right place but I only found 2012 and 2013 express :/
Albert Holguin 15-Nov-13 14:49pm    
They may have already taken off their main webpage... if you happen to have an MSDN subscription from your company you can download any version. I'm pretty sure the express editions don't have MFC though, they didn't used to have it so I imagine that's still the case.
StoyanovZ 18-Nov-13 6:16am    
I followed this tutorial today:
http://blogs.msdn.com/b/dsvc/archive/2013/07/10/switching-between-cmfcribbonbar-based-ribbon-interface-and-cmfcmenubar-cmfctoolbar-based-interface-on-the-fly.aspx

In function OnStyleRibboninterface() I get a runtime error ( "Debug Assertion Failed!" ) on this line:

m_wndMenuBar.ShowPane(FALSE, FALSE, FALSE);

For some reason it seems like m_hWnd is NULL :?
 
Share this answer
 
Comments
StoyanovZ 19-Nov-13 4:00am    
I need to add a ribbon interface to a project which was initially created without ribbons(and without the needed headers etc.).
Richard MacCutchan 19-Nov-13 4:59am    
And what is your problem in doing this?
StoyanovZ 19-Nov-13 5:36am    
Understanding what and where I have to add. But I think I sorted it out :)
StoyanovZ 20-Nov-13 8:54am    
New info - it comes out that the project is actually dialog-based. However, it's too big to make it again from scratch, so I have to add the ribbon to the current project. I read somewhere that it's possible but that's all I maneged to find :/
Richard MacCutchan 20-Nov-13 9:13am    
it comes out that the project is actually dialog-based
So what did you think it was? If you do not understand the structure of your application, then I would not expect this to be an easy change. I am not sure if the Ribbon control will work on a Dialog; I suggest you try this MSDN section for more information.

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