customizing VS.NET 2003
-
hi everyone, I've written a small application for my company and now would like it to integrate with VS.NET 2003. In the integration part, what I specifically want is to have a menu item placed in the context menu of solution explorer such that whenever the user right clicks on any .cs or .vb file, "Open with myApp" comes as a menu item in the context menu. Can anyone guide me with this? How should I go about doing this? I have seen many applications doing the same, that means this is possible. Some code snippet will be highly appreciated. thanks in advance... Cheers !! and have a Funky day !!
-
hi everyone, I've written a small application for my company and now would like it to integrate with VS.NET 2003. In the integration part, what I specifically want is to have a menu item placed in the context menu of solution explorer such that whenever the user right clicks on any .cs or .vb file, "Open with myApp" comes as a menu item in the context menu. Can anyone guide me with this? How should I go about doing this? I have seen many applications doing the same, that means this is possible. Some code snippet will be highly appreciated. thanks in advance... Cheers !! and have a Funky day !!
You'll have to convert your app to an add-in to achieve this. Once you do, the code to add a command to the context menu of the code window is straightforward:
try { Office::CommandBarPtr ptrCodeWindowCommandBar = ptrCommandBars->GetItem(CComVariant(L"Code Window") );
if (ptrCodeWindowCommandBar != NULL)
{
Office::CommandBarControlPtr ptrControl = ptrCommand->AddControl(ptrCodeWindowCommandBar, lPos);
if (ptrControl != NULL)
{
Office::_CommandBarButtonPtr ptrButton(ptrControl);
if (ptrButton != NULL)
{
ptrButton->PutStyle(Office::msoButtonAutomatic);
}
}
}
}
catch (_com_error& e)
{
HRESULT hr = e.Error();
}Writing add-ins can be a difficult task, but ultimately it's rather rewarding. Good luck! If you get stuck there's a Yahoo group devoted to the subject at http://groups.yahoo.com/group/vsnetaddin/[^]. :cool: Anna :rose: Riverblade Ltd - Software Consultancy Services Anna's Place | Tears and Laughter "Be yourself - not what others think you should be" - Marcia Graesch "Anna's just a sexy-looking lesbian tart" - A friend, trying to wind me up. It didn't work.