BCGControlBar Pro for MFC
int CBCGPRibbonBar::GetCategoryCount ( ) const

Returns a number of categories in ribbon bar.