Adding menu item [SOLVED]

On 07/05/2015 at 10:12, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   16 
Platform:   Windows  ;   
Language(s) :     C++  ;

---------
I have a simple question regarding adding sub menus to the menu bar. I can add sub menus easily with the following code:

    
    
    BaseContainer * conversionContainer = GetMenu("IDS_MENU_CONVERSION", meshContainer);
    
    if (!conversionContainer) {
        Error("Could not find IDS_MENU_CONVERSION!");
        return;
    }
    
    BaseContainer newContainer;
    newContainer.InsData(MENURESOURCE_SUBTITLE, "Custom");
    newContainer.InsData(MENURESOURCE_COMMAND, "PLUGIN_CMD_" + String::IntToString(TCUSTOM_PLUGINID));
    
    conversionContainer->InsData(MENURESOURCE_STRING, newContainer);

But how do I add a title to that command? I've been reading the description documentation, but its not clear for this case. Do I add it to a resource file? Are there any example resource files that match this case?

Thanks in advanced.

On 07/05/2015 at 10:33, xxxxxxxx wrote:

instead of:

conversionContainer->InsData(MENURESOURCE_STRING, newContainer);

do:

conversionContainer->InsData(MENURESOURCE_SUBMENU,&newcontainer);

On 07/05/2015 at 10:56, xxxxxxxx wrote:

That worked, thanks!