ArcScene startup Event Handler

Discussion created by navjohn on Mar 6, 2012
Hi Guys,

I don't have a lot of experience with Event Handlers but I am trying to fire a sub (ShutDown_Maintenance) when an ArcScene document is closed.

The problem I am having is that when adding the handler I can't find anything which will ctype to an SxDocumentEventsHelper

Public m_pApp As IApplication
Public m_pAppEvents As ESRI.ArcGIS.ArcScene.SxDocumentEventsHelper

public sub StartUp()
     ' Set the Close Event handler
     m_pAppEvents = New ESRI.ArcGIS.ArcScene.SxDocumentEventsHelper
     AddHandler CType(?????, ESRI.ArcGIS.ArcScene.SxDocumentEventsHelper).BeforeCloseDocument, AddressOf modMain.ShutDown_Maintenance

End Sub

I tried to follow the code at:
but got errors at the line:
m_pAppEvents = New ESRI.ArcGIS.ArcScene.SxDocumentEventsHelper(addressof modmain.ShutDown_Maintenance) 

- New does not have two parameters.

Can anyone tell me how this works?