In my VBA application i have a listener setup that listens for OnSketchFinished, when the polygon is created a messagebox appears and then a userform.
My problem is that the listener will work 90% of the time, not 100%.
Here are the snippets of code in ThisDocument:
Private WithEvents EditEvents As Editor Private m_pEditor As IEditor Public Sub SetEvents() ' This is the listener for the Editor Dim pID As New UID pID = "esriEditor.Editor" Set m_pEditor = Application.FindExtensionByCLSID(pID) Set EditEvents = m_pEditor End Sub Private Function MxDocument_OpenDocument() As Boolean Call SetEvents End Function Private Sub EditEvents_OnSketchFinished() Call frmCityDev.EditEvents End Sub
In my form I have code for EditEvents which brings up a msgbox to notify that a new polygon has been created.
Am I missing something to make sure that the listener will always work?