Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


Updated: October 2008

Creates and initializes a new ribbon category for the ribbon bar.

CMFCRibbonCategory* AddCategory(
   LPCTSTR lpszName,
   UINT uiSmallImagesResID,
   UINT uiLargeImagesResID,
   CSize sizeSmallImage = CSize(16, 16),
   CSize sizeLargeImage = CSize(32, 32),
   int nInsertAt = -1,
   CRuntimeClass* pRTI = NULL 

[in] lpszName

Name of the ribbon category.

[in] uiSmallImagesResID

Resource ID of the small image list for the ribbon category.

[in] uiLargeImagesResID

Resource ID of the large image list for the ribbon category.

[in] sizeSmallImage

Specifies the size of small images for the ribbon category.

[in] sizeLargeImage

Specifies the size of large images for the ribbon category.

[in] nInsertAt

Zero based index of the category location.

[in] pRTI

Pointer to a CMFCRibbonCategory Class run-time class to dynamically create a ribbon category at run-time.

A pointer to the new ribbon category if the method was successful; otherwise, NULL.

If the pRTI parameter is not NULL, the new ribbon category is created dynamically using the run-time class.

The following example demonstrates how to use the AddCategory method in the CMFCRibbonBar class.

	// Add "Home" category.
	// CMFCRibbonBar m_wndRibbonBar
	CMFCRibbonCategory* pCategoryHome = m_wndRibbonBar.AddCategory(strTemp, 

Header: afxribbonbar.h




October 2008

Updated entire topic.

Information enhancement.

© 2015 Microsoft