mailvamsee

IActiveViewEvents_Event not working

Discussion created by mailvamsee on Apr 13, 2012
Latest reply on Apr 18, 2012 by mailvamsee
Hello,

I am working on an Add-In where I need to wire up events for IActiveViewEvents_Event.ItemAdded and IActiveViewEvents_Event.ItemDeleted. Basically I need to way to execute my code when a layer is added/deleted.

I have tried:
 
m_activeViewEventsEvent = ArcMap.Document.FocusMap as IActiveViewEvents_Event;
m_activeViewEventsEvent.ItemDeleted += new IActiveViewEvents_ItemDeletedEventHandler(m_activeViewEventsEvent_ItemDeleted);
m_activeViewEventsEvent.ItemAdded += new IActiveViewEvents_ItemAddedEventHandler(m_activeViewEventsEvent_ItemAdded);


But the events never fire. This code used to work just fine in 9.3. Has something change in 10.0? Any help will be appreciated.

Thanks,
VK

Outcomes