Editing woes on different machines

108
1
01-08-2021 10:03 AM
MichaelKohler
Occasional Contributor

I'm trying to debug an add-in written a while ago. It has been maintained and updated through the various versions of desktop. Now at 10.7.1. I have several other add-ins deployed like this and have no problems running or debugging anything. The this project is different. Getting complaints from some staff that it works for them and not for others. When i try to debug, I always get stuck at the start editing line. I went remote in April of 2018 and have been having problems with this.  The error is thrown at the start editing line ""Error HRESULT E_FAIL has been returned from a call to a COM component." and   HResult is -2147467259

 

 Private Sub edit_shape()
        Dim pEditor As IEditor3 = Nothing
        Dim pUID As UID = New UIDClass() With {.Value = "esriEditor.Editor"}
        pEditor = CType(My.ArcMap.Application.FindExtensionByCLSID(pUID), IEditor3)
        Dim workspaceFactory As IWorkspaceFactory = New ShapefileWorkspaceFactory
        Dim workspace As IFeatureWorkspace = workspaceFactory.OpenFromFile("C:\temp\ram_test", 0)
        Dim pFC As IFeatureClass = workspace.OpenFeatureClass("ram_test.shp")
        pEditor.StartEditing(workspace)
        pEditor.StopEditing(False)
        MsgBox("done")
    End Sub

 

I tried to update off of the shapefile to a gdb, but can't get that to work either.

 

    Private Sub edit_gdb()
        Dim pEditor As IEditor3 = Nothing
        Dim pUID As UID = New UIDClass() With {.Value = "esriEditor.Editor"}
        pEditor = CType(My.ArcMap.Application.FindExtensionByCLSID(pUID), IEditor3)
        Dim workspaceFactory As WorkspaceFactory = New FileGDBWorkspaceFactory
        Dim workspace As IFeatureWorkspace = WorkspaceFactory.OpenFromFile("C:\temp\ram_test\ram_testing.gdb", 0)
        Dim pFC As IFeatureClass = workspace.OpenFeatureClass("ram_test")
        pEditor.StartEditing(workspace)
        pEditor.StopEditing(False)
        MsgBox("done")
    End Sub

 

 all i'm looking to do is start editing. 

Tags (2)
1 Reply
MichaelKohler
Occasional Contributor

after working with ESRI tech, they could not find the reason why. They suggested I move from IEditor3 to using IWorkspaceEdit. Since I wasn't doing anything other than creating features, this fix worked.

Reply
0 Kudos