GD_Lionel

How adding a custom ContextMenuItem to Engine ContextMenu

Discussion created by GD_Lionel on Feb 23, 2011
Hallo everyone,

I tryed to make a custom ContextMenu für my Engine-Application. FOr this, I was following the guide on this site
"http://edndoc.esri.com/arcobjects/9.2/NET/235a75b3-00e3-41bf-b0de-63d05751eafa.htm"

This works fine with the predefined Commands listet here
"http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/00010000039p000000.htm"


Now, I would like to fill the ContextMenu with my proper Items. So I Created a new "Base Command" for a MapControl. But when I try to add this new commant to the ContextMenuObject, it thows an exception telling me the "class is not registered (REGDB_E_CLASSNOTREG)"

I didn't changed anything at the command.. ist still like
<ComClass(Command1.ClassId, Command1.InterfaceId, Command1.EventsId), _
 ProgId("Application.Command1")> _
Public NotInheritable Class Command1
    Inherits BaseCommand
....


and i try to add it
Public Class ContextMenuEngineEditorVertices
....
Public Sub SetHook(ByVal hook As Object)

  m_toolbarMenu = New ToolbarMenuClass()
  m_toolbarMenu.SetHook(hook)
    
  AddItem("Application.Command1", -1)

End Sub
.....
End Class


Does somebody know why I cant add this Item to the contextMenu ?

Outcomes