Implement Icommand in VB.net

533
2
07-01-2023 08:50 PM
Suman_Kar
New Contributor

I want to implement Icommand in VB.net. After build the dll file when I try to load this dll file in Arcmap 10.8 then it shows that can't load type library from specified file. I have used below code for implement this dll file. Please help on this

Imports ESRI.ArcGIS.SystemUI

Public Class Class1

Implements ESRI.ArcGIS.SystemUI.ICommand

Public Sub OnCreate(Hook As Object) Implements ICommand.OnCreate
m_pApp = Hook
Throw New NotImplementedException()

End Sub

Public Sub OnClick() Implements ICommand.OnClick
Throw New NotImplementedException()
Dim MyForm As New Form1
MyForm.Show()
End Sub

Public ReadOnly Property Enabled As Boolean Implements ICommand.Enabled
Get
Enabled = True
Throw New NotImplementedException()

End Get
End Property

Public ReadOnly Property Checked As Boolean Implements ICommand.Checked
Get
Throw New NotImplementedException()
End Get
End Property

Public ReadOnly Property Name As String Implements ICommand.Name
Get
Name = "Merge Geodatabase V2.0"
Throw New NotImplementedException()

End Get
End Property

Public ReadOnly Property Caption As String Implements ICommand.Caption
Get
Caption = "Merge Geodatabase V2.0"
Throw New NotImplementedException()

End Get
End Property

Public ReadOnly Property Tooltip As String Implements ICommand.Tooltip
Get
Tooltip = "Merge Geodatabase V2.0"
Throw New NotImplementedException()

End Get
End Property

Public ReadOnly Property Message As String Implements ICommand.Message
Get
Throw New NotImplementedException()
End Get
End Property

Public ReadOnly Property HelpFile As String Implements ICommand.HelpFile
Get
HelpFile = ""
HelpFile = "Merge.hlp"
Throw New NotImplementedException()

End Get
End Property

Public ReadOnly Property HelpContextID As Integer Implements ICommand.HelpContextID
Get
HelpContextID = 10001
Throw New NotImplementedException()

End Get
End Property

Public ReadOnly Property Bitmap As Integer Implements ICommand.Bitmap
Get
Throw New NotImplementedException()

End Get
End Property

Public ReadOnly Property Category As String Implements ICommand.Category
Get
Category = "Land_Suman"
Throw New NotImplementedException()

End Get
End Property
End Class

0 Kudos
2 Replies
BrentHoskisson
Occasional Contributor III

This looks like an older method of adding commands.  I recommend using Add-Ins.  ESRI has a walk-through Here .  

 

Brent Hoskisson

 

0 Kudos
DuncanHornby
MVP Notable Contributor

It's a long time since I've developed a DLL for ArcMap. AddIns are the much better way of developing and distributing customisation. That said I remember DLL's developed in .Net needed to be registered using RegASM.exe, have a look at the Q&A from 12 years ago...

0 Kudos