//*************************************************************************
// BCMenu.cpp : implementation file
-// Version : 3.033
-// Date : April 2002
+// Version : 3.034
+// Date : May 2002
// Author : Brent Corkum
// Email : corkum@rocscience.com
// Latest Version : http://www.rocscience.com/~corkum/BCMenu.html
if(m_AllSubMenus[n]==m_SubMenus[m])m_AllSubMenus.RemoveAt(n);
}
CMenu *ptr=FromHandle(m_SubMenus[m]);
- BOOL flag=ptr->IsKindOf(RUNTIME_CLASS( BCMenu ));
- if(flag)delete((BCMenu *)ptr);
+ if(ptr){
+ BOOL flag=ptr->IsKindOf(RUNTIME_CLASS( BCMenu ));
+ if(flag)delete((BCMenu *)ptr);
+ }
}
m_SubMenus.RemoveAll();
// Destroy menu data
if(nPosition<(UINT)menustart)menustart=0;
}
m_AllSubMenus.Add((HMENU)nID);
- m_SubMenus.InsertAt(nPosition,(HMENU)nID);
+ m_SubMenus.Add((HMENU)nID);
}
//Stephane Clog suggested adding this, believe it or not it's in the help
if(nFlags & MF_POPUP){
m_AllSubMenus.Add((HMENU)nID);
- m_SubMenus.InsertAt(nPosition,(HMENU)nID);
+ m_SubMenus.Add((HMENU)nID);
}
//Stephane Clog suggested adding this, believe it or not it's in the help
if(mdata){
HMENU bchmenu=(HMENU)mdata->nID;
CMenu *ptr=FromHandle(bchmenu);
- BOOL flag=ptr->IsKindOf(RUNTIME_CLASS( BCMenu ));
- if(flag)return((BCMenu *)ptr);
+ if(ptr){
+ BOOL flag=ptr->IsKindOf(RUNTIME_CLASS( BCMenu ));
+ if(flag)return((BCMenu *)ptr);
+ }
}
return NULL;
}
//*************************************************************************
// BCMenu.h : header file
-// Version : 3.033
-// Date : April 2002
+// Version : 3.034
+// Date : May 2002
// Author : Brent Corkum
// Email : corkum@rocscience.com
// Latest Version : http://www.rocscience.com/~corkum/BCMenu.html