views:

64

answers:

1

I am trying to catch Visual Studio Extension events in browser javascript, DTE is available through window.external:

window.external.DTE.Events.SolutionEvents.Opened = ...

Access is ok up to "Events", but a SolutionEvents seems not to be found. I've checke the #imported tlb, _Events does have a get_SolutionEvents member.

DTE is the correct object (calling some methods through it works fine...)

I haven't done much yet with DTE, and I'm a complete javascript n00b. Any suggestions?


[update] The javascript runs in a web browser control hosted in a DTE tool window. The addin is written in C++/ATL.

+2  A: 

As a quick answer, without asking why you need this, I would...

  • Through a C# handler catch the Opened event.
  • From there, I would call a Javascript method in your web page by using DOM.

Is your javascript loaded in a WebBrowser control? It would be easier to access DOM.

More info on DOM : http://msdn.microsoft.com/en-us/library/aa290341%28VS.71%29.aspx

Cedrik
This quick answer is post number 2,222,222 on StackOverflow. Congratulations!
Daniel Daranas
Congrats, Cedrik ;) As for the why: A HTML page with access to DTE, ShellExecute and replacement tokens makes a good functional replacement fore the start page. I am looking for a generic way to attach to these events without having to forward them from my addin.
peterchen
Post 2,222,222! Do I get a StackOverflow shirt? ;)
Cedrik
you certainly should ;) It's the solution I was trying to avoid, but further poking around seems that this (or any other extra code) is the only solution.
peterchen