Hellou
I'm trying to catch EnvDTE.ProjectItemsEvents.
so i use:
1)
applicationObject = (_DTE)application;
CSharpProjectItemsEvents =
(EnvDTE.ProjectItemsEvents)applicationObject.Events.GetObject("CSharpProjectItemsEvents");
CSharpProjectItemsEvents.ItemAdded += new
_dispProjectItemsEvents_ItemAddedEventHandler(this.CSSolutionItemsEvents_ItemAdded);
works fine!
2)
applicationObject = (_DTE)application;
EnvDTE.Events events = applicationObject.Events;
solutionItemsEvents = (EnvDTE.ProjectItemsEvents)events.SolutionItemsEvents;
solutionItemsEvents.ItemAdded += new
_dispProjectItemsEvents_ItemAddedEventHandler(this.SolutionItemsEvents_ItemAdded);
DOESN'T WORK! WHY?
i tried adding everything:
project to sol,
class, form to proj
and many other things
this event doesn't occur
what's wrong?
PS: this is my favourite web site :P
Carlos J. Quintero [.NET MVP] - 10 Dec 2004 09:14 GMT
It's a known issue. Ensure that the variables CSharpProjectItemsEvents and
solutionItemsEvents are declared at module level and not at procedure level.
Otherwise they will be garbage-collected.

Signature
Carlos J. Quintero
The MZ-Tools all-in-one add-in, now for .NET: http://www.mztools.com
> Hellou
>
[quoted text clipped - 27 lines]
>
> PS: this is my favourite web site :P