RemovePlugInMenuFromRhino doesn't work


#1

Hello

I’m doing the following:

BOOL CPlugIn::OnLoadPlugIn()
{
	m_menu.LoadMenu(IDR_RENDERMENU);
	InsertPlugInMenuToRhinoMenu(m_menu.GetSafeHmenu(), 0);

and

void CPlugIn::OnSetCurrentRenderPlugIn(BOOL bCurrent)
{
	if(!bCurrent)
	{
		RemovePlugInMenuFromRhino(m_menu.GetSafeHmenu()); // !!!!!!! has no effect

(Dale Fugier) #2

If you read the comments for CRhinoPlugIn::InsertPlugInMenuToRhinoMenu, you will see that the method gets a submenu, from the specified menu, by index. Thus, if you want to remove it, you will have to get the handle to the submenu and pass it to CRhinoPlugIn::RemovePlugInMenuFromRhino. I’ve updated the SampleMenu project to demonstrate how to do this.