关于BCMenu类中图标的有关问题,为什么只能显示出前15个ICON在MENU上

关于BCMenu类中图标的问题,为什么只能显示出前15个ICON在MENU上?
用了BCMenu类,我做了一个BMP图片,里面都是16*16的ICON连在一起,完全模仿DEMO中的图片做的,可是在我程序里,BCMenu为什么只能读出前15个ICON,后面的ICON都读不到呢?导致我的菜单中前15个ITEM是有图标的,后面的ITEM都没有图标,主要读ICON的代码如下:
BOOL   BCMenu::LoadToolbar(UINT   nToolBar)
{
UINT   nID,nStyle;
BOOL   returnflag=FALSE;
BCMenuToolBar   bar;
int   xoffset=-1,xset;
int   iconx,icony;

CWnd*   pWnd   =   AfxGetMainWnd();
if   (pWnd   ==   NULL)pWnd   =   CWnd::GetDesktopWindow();
bar.Create(pWnd);
if(bar.LoadToolBar(nToolBar))
{
//CToolBar   b;
//b.LoadToolBar(MAKEINTRESOURCE(nToolBar));
//int   cou=b.GetCount();
int   cou=bar.GetCount();


bar.GetIconSize(iconx,icony);
if(iconx> m_iconX)m_iconX=iconx;
if(icony> m_iconY)m_iconY=icony;
CImageList   imglist;
imglist.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1);
if(AddBitmapToImageList(&imglist,nToolBar))
{
int   t=imglist.GetImageCount();
returnflag=TRUE;

for(int   i=0;i <bar.GetCount();++i)
{
nID   =   bar.GetItemID(i);  
if(nID   &&   GetMenuState(nID,   MF_BYCOMMAND)!=0xFFFFFFFF)
{
xoffset=bar.CommandToIndex(nID);
if(xoffset> =0)
{
bar.GetButtonInfo(xoffset,nID,nStyle,xset);
if(xset> 0)xoffset=xset;
}
ModifyODMenu(NULL,nID,&imglist,xoffset);
}
}
}
}
return(returnflag);
}

------解决方案--------------------
我的只有九个 但是也发生一件奇怪的事情。运行时间一旦超过1分钟,就开始不停的泄露内存。