saipo

pEditor.StopEditing(True) CRASHING ARCMAP

Discussion created by saipo on Dec 20, 2011
Latest reply on Dec 21, 2011 by sean_jones-esristaff
Hi all,

Could some PLEASE point out why the code below works for polyline and polygon layers but not point layers.  I have tried it on various different point layers with no luck.
Arcmap just crashes out and gives me the send error log window.  Using arcmap 10 SP3.


  Private Sub myEditorEvents_OnSketchFinished() Handles myEditorEvents.OnSketchFinished

        Dim pMxDoc As IMxDocument
        pMxDoc = My.ArcMap.Application.Document 'ThisDocument

        Dim pEditor As IEditor
        Dim pID As ESRI.ArcGIS.esriSystem.UID = New ESRI.ArcGIS.esriSystem.UIDClass

        Dim theapp As ESRI.ArcGIS.Framework.IApplication
        theapp = My.ArcMap.Application

        pID.Value = "esriCore.Editor"
        pEditor = theapp.FindExtensionByCLSID(pID)


        pEditor.StartOperation()
        Dim pFeature As IFeature
        Dim pEnumFeat As IEnumFeature
        Dim pUID As New UID
        pUID.Value = "esricore.editor"

        pEditor = My.ArcMap.Application.FindExtensionByCLSID(pID)
        pEnumFeat = pEditor.EditSelection
        pEnumFeat.Reset()
        pFeature = pEnumFeat.Next
        pFeature.Store()
        pEditor.StopEditing(True)

Outcomes