473,387 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

using ext_cm_Solution - never fires

I have tried to add a new command for a visual studio add-in. This command
should be added when the user loads any solution into the IDE(not at
startup). The command should disappears when the user closes the solution.

The MSDN says that ext_cm_Solution 4 The Add-in was loaded when a user
loaded a solution that required the Add-in.
So I have checked the connectmode in OnConnection method for the value
"ext_cm_Solution". Seems the caller of OnConnection never sends the value
ext_cm_Solution. I have inserted a MessageBox.Show(connectMode.ToString())
at the start of the function. I have not got the value ext_cm_Solution.

Here is my code segment
public void OnConnection(object application, Extensibility.ext_ConnectMode
connectMode, object addInInst, ref System.Array custom)

{

applicationObject = (_DTE)application;

addInInstance = (AddIn)addInInst;

MessageBox.Show(connectMode.ToString());

if(connectMode == Extensibility.ext_ConnectMode.ext_cm_Solution)

{

object []contextGUIDS = new object[] { };

Commands commands = applicationObject.Commands;

_CommandBars commandBars = applicationObject.CommandBars;

try

{

Command command = commands.AddNamedCommand(addInInstance,

"CleanCodeReviewComments",

"Clean Code Review Comments",

"Executes the command for CRAddIn",

false, 101, ref contextGUIDS,

(int)vsCommandStatus.vsCommandStatusSupported+(int )vsCommandStatus.vsCommand
StatusEnabled);

CommandBar commandBar = (CommandBar)commandBars["Tools"];

CommandBarControl commandBarControl = command.AddControl(commandBar, 1);

}

catch(System.Exception e)

{

MessageBox.Show(e.ToString());

}

}
}

Thanks,

-Seeni
Nov 20 '05 #1
1 931
"seeni" <m_***********@hotmail.com> schrieb
I have tried to add a new command for a visual studio add-in. This
command should be added when the user loads any solution into the
IDE(not at startup). The command should disappears when the user
closes the solution.


Please post only to the appropriate groups. Thanks.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Josh Usovsky | last post by:
I'm setting up a watched folder using FileSystemWatcher. When I drop a small file into the watched folder, I can respond to a .Created event and process the file with other code. However, if I try...
1
by: seeni | last post by:
I have tried to add a new command for a visual studio add-in. This command should be added when the user loads any solution into the IDE(not at startup). The command should disappears when the user...
5
by: Maxine G | last post by:
I have two forms, a menu and a data entry form. The entry form is bound to a query against linked SQL server tables. In the deactivate event, I have some code which asks the user if they want to...
19
by: Heidi Hundåla | last post by:
Hi ! I have a Wep App in C#. Page_Unload fires after Page_Load, and it seems totally unreasonable when you want to use this event when you _leave_ the page. In my project we wanted to use...
1
by: vidya | last post by:
Hi, I have a button which is a web control. I have some validation in javascript for the button in .aspx file and some in the button onclick event in code behind(C#). I need to get through both...
15
by: Swetha | last post by:
Hello I have a DropDownList that I am populating using the following SqlDataSource: <asp:DropDownList ID="parentIDDropDownList" runat="server" DataSourceID="SqlDataSource3"...
9
by: J055 | last post by:
Hi I'm trying to get an instance of UserLists to persist after it's been used by the GridView. I understand from the documentation that The OnObjectCreated event allows access to the instance. I...
6
by: Joseph Geretz | last post by:
I'm porting a C# Outlook Addin originally engineered as a COM Addin over to use VSTO. I've gotten this to the point where my VSTO Addin installs its Menu items and Toolbar buttons when Outlook...
1
by: Dave | last post by:
I have a listview control in a form, and I use the mousemove event (to set a tooltip). This worked fine in VS2003, but when I ported it to VS2005 I found that when the mouse hovers over a populated...
0
by: slemen | last post by:
My GridView is bound in VB code to a DataTable. The RowUpdating event fires when the row's Update linkbutton is clicked and the row contains the old, pre-edited values (as is expected.) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.