The Windows Ribbon Framework
(Page 1 of 4 )
Throughout our history it seems as if the most revolutionary ideas just pop out of someone’s head at a given moment. Then again, there are some that are obtained through deep research. The appearance of the Ribbon in the Microsoft Office environment is the result of the latter. However, inventing something does not necessarily mean instantly making it accessible to the masses. For this, another group of developers from the Redmond giant created the Ribbon Framework.
I have already disclosed some information about how the framework works in one of my previous articles, Markup Language for the Ribbon Framework. There I explained that the process of creating a ribbon is split into two parts, design and function. I tried to give a teaser about the first part in my previous articles. Naturally I just presented some general traits and coded a simple example.
I had no intention to cover the Markup language used in depth. For that you have the MSDN library, which is quite complete on this topic. Today I will focus on the second part, function. I will present how to get from the binary files to a working application. I will continue to use the HTML edit sample within Visual Studio 2008 to make my point in practice.
I hope that you've already linked the XML up with the UICC.exe from last time, and managed to generate the binary code from it, along with the resource file and the header full of definitions. For starters, we will need to add these to our solution. Open up the rc file (or just get to the resource includes from the Resource View) and add the include:
#include "RibbonRes/ribbonres.rc2"
You can also add it to the solution if you want better handling. However, this is not necessary. Now we can continue to create a ribbon. The content on the following pages should be easy to comprehend for anyone who has good knowledge of C++ and MFC.
Next: Creating it >>
More .NET Articles
More By Gabor Bernat