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 / March 2006

Tip: Looking for answers? Try searching our database.

Getting access to my add-in from within an event handler

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mclagett - 26 Mar 2006 23:44 GMT
Hi --

I was hoping someone might have an idea about how I can get access to an
instance of my add-in from within the context of a DebuggerEvent handler.  My
need is to have the target application being debugged have access to the
Visual Studio extensibility model so that it can create new windows and panes
to output information while it is running.  Originally I was dealing with the
DTE object directly from my application and just using the Output window to
add panes to, but I've now inserted an add-in in the middle, as apparently
this is needed for creating new IDE windows.  

I came up with what I thought seemed like a pretty reasonable scheme: to
have the add-in use the Running Object Table to install a moniker that the
application could then use to establish communication with it.  I figured I'd
use the OnEnterRunMode event to do this at the last possible moment, so that
I could keep the time required for this handshaking down to a minimum.  But
now that I've put all this in place, I realize that when my event handler is
executing there is no access to the add-in whose handle I need to register
with the ROT.  This is a predefined event handler signature and there's only
one DbgEventReason parameter that gets passed to my handler; not the add-in
instance handle that I need.  I could use a global variable that could be set
by the add-in when it was loading, but then my question is How Global Is It?  
If I use a global variable in my add-in code, is it global to all add-in's
across multiple instances of Visual Studio that might be running or just the
Visual Studio instance where my event handler would be firing?

Of course I'm off to try that nauseating kludge, but if in the meantime
anyone has any thoughts for me, I'd greatly appreciate it.

Regards,

Mike
Carlos J. Quintero [VB MVP] - 27 Mar 2006 09:29 GMT
Hi,

I'm not sure if this will work or not, but if you have access to the DTE,
there is a DTE.AddIns collection. For each AddIn you can query its Name and
Connected status. The AddIn.Object property gives you access to the internal
class of the add-in (the Connect class) so you can call methods of it (to
create a toolwindow, for example).

Signature

Best regards,

Carlos J. Quintero

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

> Hi --
>
[quoted text clipped - 41 lines]
>
> Mike

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.