Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a ribbon menu to an existing MFC application?

Microsoft Visual C++ 2008 Feature Pack has ribbon menu support. Is it possible to make use of that in an existing MFC application that was not created with a ribbon menu?

like image 796
yesraaj Avatar asked Apr 17 '09 13:04

yesraaj


People also ask

How do I add MFC to Visual Studio?

From the main menu, choose File > New > Project. Under the Installed templates, choose Visual C++ > MFC/ATL. If you don't see these, use the Visual Studio Installer to add them. Choose MFC Application from the center pane.


1 Answers

It certainly is possible to take an existing MFC application and update it to use the ribbon in the MFC Feature Pack, and I've done this myself.

There are a couple of walkthrough articles on MSDN here that show how to do it, using the Scribble MFC sample application that you may be familiar with.

In essence, what you need to do is change your code to use the Feature Pack base classes instead of the standard MFC base classes - for example, replace CWinApp with CWinAppEx, CFrameWnd with CFrameWndEx, etc. Then you can add CMFCRibbonBar and CMFCRibbonApplicationButton objects to your main window class to create the ribbon itself. To get started I'd suggest downloading the Scribble sample and following the walkthough articles.

I hope this helps!

like image 67
ChrisN Avatar answered Dec 07 '22 23:12

ChrisN