Select to view content in your preferred language

EditTask not shown in dropdown of tasks

539
1
08-23-2011 03:46 AM
JohanHallgren
Emerging Contributor
I've got two very similar classes implementing the IEditTask interface. The two tasks shows up in the dropdown-menu of tasks (ArcMap 9.3.1) both on my computer and on my collegues. But on my clients computer only one of them shows up... I've been searching through the Categories-application and both tasks seem to be registered correctly.

There has been some earlier extensions also named "Blabla" which wasn't uninstalled correctly (found them when searching through the registry), but none of them had the exact same name or guid.

Any ideas?

using System;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.ADF.CATIDs;
using ESRI.ArcGIS.Editor;

namespace Blabla
{
  [Guid("e5f0320f-d2fc-4b5d-8e26-0b310b8b7178")]
  [ClassInterface(ClassInterfaceType.None)]
  [ProgId("Blabla.ALine")]
  public class ALine : IEditTask
  {
    #region Private fields

    private readonly GeometryGenerator m_generator = new GeometryGenerator();

    #endregion

    #region Component Category Registration

    [ComRegisterFunction]
    [ComVisible(false)]
    static void RegisterFunction(String regKey)
    {
      EditTasks.Register(regKey);
    }

    [ComUnregisterFunction]
    [ComVisible(false)]
    static void UnregisterFunction(String regKey)
    {
      EditTasks.Unregister(regKey);
    }

    #endregion

    #region Implementation of IEditTask

    public void Activate(IEditor editor, IEditTask oldTask)
    {
      m_generator.Activate(editor);
    }

    public void Deactivate()
    {
      m_generator.Deactivate();
    }

    public string Name
    {
      get
      {
        return "ALine";
      }
    }

    public void OnDeleteSketch()
    {
    }

    public void OnFinishSketch()
    {
      m_generator.FinishSketch();
    }

    #endregion
  }
}


using System;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.ADF.CATIDs;
using ESRI.ArcGIS.Editor;

namespace Blabla
{
  [Guid("232c11f1-f1ee-44ab-80f7-3d3398021c97")]
  [ClassInterface(ClassInterfaceType.None)]
  [ProgId("Blabla.BLine")]
  public class BLine : IEditTask
  {
    #region Private fields

    private readonly GeometryGenerator m_generator = new GeometryGenerator();

    #endregion

    #region Component Category Registration

    [ComRegisterFunction]
    [ComVisible(false)]
    static void RegisterFunction(String regKey)
    {
      EditTasks.Register(regKey);
    }

    [ComUnregisterFunction]
    [ComVisible(false)]
    static void UnregisterFunction(String regKey)
    {
      EditTasks.Unregister(regKey);
    }

    #endregion

    #region Implementation of IEditTask

    public void Activate(IEditor editor, IEditTask oldTask)
    {
      m_generator.Activate(editor);
    }

    public void Deactivate()
    {
      m_generator.Deactivate();
    }

    public string Name
    {
      get
      {
        return "BLine";
      }
    }

    public void OnDeleteSketch()
    {
    }

    public void OnFinishSketch()
    {
      m_generator.FinishSketch();
    }

    #endregion
  }
}
0 Kudos
1 Reply
JohanHallgren
Emerging Contributor
continued...

Are the entries in the Task-dropdown stored somewhere in a config-file or is it only populated from what's currently in the registry? I find it strange that both EditTask:s shows up in categories.exe, but only one of them in ArcMap... I've tried to strip down the missing EditTask of all code, and also creating new, empty EditTasks, but none show up... I've also tried to create the second EditTask in a separate dll, and that one doesn't show up either, not even when only having that specific dll registered!

I've tried to delete the Normal.mxt file, but that didn't work either.
0 Kudos