locked
Visual Studio 2010: Get COM error 0x80004001 when creating control drop down by CommandBarControls::Add() RRS feed

  • Question

  • I am still porting codes from VS2005 to VS2010. This time, a COM error  0x80004001 is watched when trying to add a control drop down to tool bar by CommandBarControl::Add(), the parameter given to this API is:

     

    _CommandBarComboBoxPtr commandBarControl; 
    commandbarControls->Add( CComVariant(msoControlDropdown), CComVariant(1), CComVariant(static_cast<LPCWSTR>(nullptr)), CComVariant(12), CComVariant( VARIANT_TRUE ), (CommandBarControl**)&commandBarControl
    );

     

    After some searching effort, from the following URLs, I noticed that adding control combo box by DTE (CommandBarControl::Add) may not be supported in VS2010.

        https://msmvps.com/blogs/carlosq/archive/2010/02/26/no-longer-possible-to-create-comboboxes-on-commandbars-of-vs-2010-through-automation-envdte-only-through-packages.aspx

        https://connect.microsoft.com/VisualStudio/feedback/details/532817/exception-deprecatedexception-occurs-when-adding-a-combobox-to-vs2010-ide-toolbar

    I don't know if control drop down is not allowed in VS2010? Or I just call this API with bad input argument in VS2010?

     



    Monday, June 20, 2011 6:08 AM

Answers