0

Ok, here is the situation. I am looking to get a custom arcobjects vb.net extension running correctly on ArcMap10.5. When loading nodes in an attachment viewer I receive the following error once Private Sub LoadNodes() is called.

System.TypeLoadException: Types extending from COM objects should override all methods of an interface implemented by the base COM class.

If I remove these lines from LoadNodes() I don't get the System.TypeLoadException: and the program runs through LoadNodes() but obviuously fails because the Attachment table is missing.

   ' Get relAttachments table and set selection table for it
    Dim relAttach As ESRI.ArcGIS.Carto.StandaloneTable = New cAttachStandAloneTable(mFWS.OpenTable(modDBNaming.GetQualifiedTableName("RelAttachments", mFWS)), "FCName")
    mRelAttachSel = relAttach

Somehow this issue is related to the newer environment because this issue does not occur in the old environment.

Current Environment: Visual Studio 13 .net framework 4.5 ArcMap and Arcobjects 10.5 (10.4 has the same issue)

Old Environment: Visual Studio 8 .net framework 3.5 ArcMap and ArcAobjects 10.2.2 and older

Here are the beginning steps of LoadNodes()

Private Sub LoadNodes()
    Try
        lblStatus.Text = "Populating the tree view with the database layers"
        Me.Cursor = Windows.Forms.Cursors.AppStarting

    ' Get relAttachments table and set selection table for it
    Dim relAttach As ESRI.ArcGIS.Carto.StandaloneTable = New cAttachStandAloneTable(mFWS.OpenTable(modDBNaming.GetQualifiedTableName("RelAttachments", mFWS)), "FCName")
    mRelAttachSel = relAttach

    ' Load relAttachments into dataset datatable
    PopulateRelAttachmentsTable(relAttach.Table)
    Dim relAttachDV As DataView = New DataView(mDataset.Tables("relAttachments"))

    ' Clear out reachnodes hashtable
    mReachNodes.Clear()

    ' Run through any selected features and store in table
    If mStandAlone = False Then
        PopulateSelectionTable()
    End If
    Dim selDV As DataView = New DataView(mDataset.Tables("Selection"))

    ' Clear the tree
    tvStream.Nodes.Clear()

Code from frmAttachViewer

' Load the dictionaries
            LoadDictionaries()
            MessageBox.Show("Loaded Dictionaries")

            ' Load the featureclass names into cboFeatureclass
            For Each de As DictionaryEntry In mLayerTab
                cboFeatureClass.Items.Add(de.Key)
            Next

            ' Load the tree view nodes
            LoadNodes()

            ' "Open" the reaches that have been selected (or features in them were selected)
            mSuppressSelChanges = False
            If mStandAlone = False Then
                MapSelectionChanged()
            End If


        Catch ex As Exception
            StreamAnalyst_AGS10.ErrorHandler.ShowErrors(ex, "Warn", "An error occurred while loading the form")
            log.Warn("An error occurred while loading the form", ex)
  • What is 'cAttachStandAloneTable'? That's not a type. – danielm Feb 6 at 16:58
  • Public Class cAttachStandAloneTable Inherits ESRI.ArcGIS.Carto.StandaloneTableClass Private _DisplayField As String Private _Name As String Private _Table As ESRI.ArcGIS.Geodatabase.ITable Private _Valid As Boolean Private _SelectionSet As ESRI.ArcGIS.Geodatabase.ISelectionSet – TDurden Feb 6 at 19:22
  • Okay, what is the code for the relevant constructor? Or before that, is it one of the sub calls on that line that causes the error or the constructor for cAttachStandAloneTable. – danielm Feb 6 at 19:32
  • I am not sure what the relevant constructor is but I added where they failure occurs. I walked it through through the LoadDictionaries() successfully but then one it hits LoadNodes() the next step when debugged is Catch ex As Exception. – TDurden Feb 6 at 20:20
  • Also as I mention in the original post, when the cAttachStandAloneTable line is removed, LoadNodes() does not cause the System Type load exception. – TDurden Feb 6 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.