我正在将CenterSnap.cls从其 vb 版本迁移到 vb.NET,在将 vb6 项目导入 VS 2008 后,我对以下 2 个错误感到困惑。
错误 1
Imports System.Runtime.InteropServices
Imports ESRI.ArcGIS.esriSystem
<System.Runtime.InteropServices.ProgId("StackMap.CenterSnap")>
Public Class CenterSnap
Implements ESRI.ArcGIS.Editor.ISnapAgent
Implements ESRI.ArcGIS.esriSystem.IPersistVariant ' <<<<ERROR 1
错误 1 类“CenterSnap”必须为接口“ESRI.ArcGIS.esriSystem.IPersistVariant”实现“ReadOnly Property ID As UID”。实现属性必须具有匹配的“ReadOnly”或“WriteOnly”说明符。C:\Projects\VB_ActiveX_dll\StackMap\StackMap\CenterSnap.vb 9 16 StackMap
错误 2
Private ReadOnly Property IPersistVariant_ID() As ESRI.ArcGIS.esriSystem.IUID _
Implements ESRI.ArcGIS.esriSystem.IPersistVariant.ID '<<<< ERROR 2
错误 2“IPersistVariant_ID”无法实现“ID”,因为接口“ESRI.ArcGIS.esriSystem.IPersistVariant”上没有匹配的属性。C:\Projects\VB_ActiveX_dll\StackMap\StackMap\CenterSnap.vb 16 94 StackMap
Get
Dim pID As New ESRI.ArcGIS.esriSystem.UID
pID.Value = "CenterSnap.clsCenterSnap"
IPersistVariant_ID = pID
End Get
为什么Implements ESRI.ArcGIS.esriSystem.IPersistVariant
没有实施?我在项目中引用了 ESRI.esriSystem。