Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / February 2005

Tip: Looking for answers? Try searching our database.

Add-In: Create CommandBarControl (menu item) in C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christoph Wienands - 01 Feb 2005 20:10 GMT
Hey guys,

I'm stuck with a really stupid problem. I'm trying to create a new top-level
menu item, just like "Tools" or "Edit". This is my code.

CommandBarControl objMenuItem = objDte.CommandBars["MenuBar"].Controls.Add(
vsCommandBarType.vsCommandBarTypePopup, null, null, null, null);

I'm getting the error message:
System.ArgumentException: The parameter is incorrect.

All the examples and documentation is for VB or VB.Net where you can neglect
optional parameters. I think the problem is that the method wants to have
something different then null.

Anybody any idea?

Thanks, Christoph
Carlos J. Quintero [.NET MVP] - 03 Feb 2005 09:47 GMT
Hi Christoph,

In C# try passing Type.Missing instead of null.

Signature

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com

> Hey guys,
>
[quoted text clipped - 15 lines]
>
> Thanks, Christoph

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.