Search the web
Sign In
New User? Sign Up
vsnetaddin · Visual Studio.NET Add-ins
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Display Tools menu item add-in   Message List  
Reply | Forward Message #3868 of 3878 |
Greetings,

I've an add-in that loads fine but shown as 'dimmed' or 'disabled' in
Tools menu. Here is the OnConnect function implementation:

Try
_applicationObject = CType(application, EnvDTE80.DTE2)
_addInInstance = CType(addInInst, EnvDTE.AddIn)
If connectMode = ext_ConnectMode.ext_cm_UISetup Then
Dim objAddIn As AddIn = CType(addInInst, AddIn)
Dim CommandObj As Command
Dim objCommandBar As CommandBar

ClearExistingCommands()
objCommandBar =
CType(_applicationObject.Commands.AddCommandBar("CommenterMacros",
vsCommandBarType.vsCommandBarTypeMenu,
_applicationObject.CommandBars.Item("Tools")),
Microsoft.VisualStudio.CommandBars.CommandBar)

CommandObj =
_applicationObject.Commands.AddNamedCommand(objAddIn,
"InsertSeeAlsoTag", "InsertSeeAlsoTag", "TODO: Enter your command
description", True, 59, Nothing, 1 + 2)
CommandObj.AddControl(objCommandBar)
End If
Catch ex As Exception
MsgBox(ex.StackTrace, MsgBoxStyle.Information, "Add-in Error")
End Try

'***************************

Where the ClearExistingCommands function as follows:

Private Sub ClearExistingCommands()
Try
For Each cmd As CommandBarControl In
CType(_applicationObject.CommandBars.Item("Tools"), CommandBar).Controls
If cmd.Caption = "CommenterMacros" OrElse cmd.Caption
= "CommentMacros" Then
cmd.Delete()
End If
Next
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "Add-in Error")
End Try
End Sub
'**********************************************
When i debug the code it fires an exception on the line:

CommandObj = _applicationObject.Commands.AddNamedCommand(objAddIn,
"InsertSeeAlsoTag", "InsertSeeAlsoTag", "TODO: Enter your command
description", True, 59, Nothing, 1 + 2)

"A Command with that name already exists.". Am i missing something??




Sun Jun 8, 2008 12:16 pm

noha_assem2030
Offline Offline
Send Email Send Email

Forward
Message #3868 of 3878 |
Expand Messages Author Sort by Date

Greetings, I've an add-in that loads fine but shown as 'dimmed' or 'disabled' in Tools menu. Here is the OnConnect function implementation: Try ...
noha_assem2030
Offline Send Email
Jun 8, 2008
12:18 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help