none
Outlook Custom TaskPane Control Registration "unable to create specified activex control" RRS feed

  • Question

  • Hi,

    I successfully created a custom task pane for outlook and run it on my computer by registering the DLL using "regasm assemblyfile".I read that the DLL registration is required to avoid the "unable to create specified activex control".

    Now I am deploying my addin to a shared folder using ClickOnce publishing (VSTO file is generated), and found that the DLL needs to be registered for the custom pane to work.

    Any ideas on how to register the DLL as part of the ClickOnce deployment ?

     

    Thanks

     


    Wednesday, April 6, 2011 2:07 PM

All replies

  • Hi Madani,

     

    Thanks for posting in the MSDN Forum.

     

    According to your description, your use an ActiveX Control in your Custom Task Pane of the Outlook and you want to distribute your Custom Task Pane via ClickOnce.

     

    If I have misunderstood anything, please feel free to let me know.

     

    Please take a look at http://msdn.microsoft.com/en-us/library/ms165432(VS.80).aspx . I hope it can help you.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, April 8, 2011 5:51 AM
    Moderator
  • Hi Tom,

    Thank you for your reply.My task pane is just a normal .NET windows user control.The reason i called it 'activex control' is that all the articles and books i refer to on this subject state that the task pane will be treated as an Activex control for it to be loaded by the Addin, and that registering the control is required so the Addin can see it.

    My task pane is part of my addin project (in a sinlge project).I am using ClickOnce deployment and publishing the .vsto file to a LAN shared folder.

     

    My question: how can let the addin see my task pane and load it ?.During the testing on my computer, if I register the DLL using regasm, everything works fine, but the moment i deploy to end user computers, the task pane fails to load.

     

    Regards,

     

    Madani

     

    Monday, April 11, 2011 12:22 PM
  • Hi Madani,

     

    I still puzzled with your user control. It seems you wrap this control in a dll file and use the dll file in the solution. Is it right?

     

    I try to reproduce your issue via follow steps:

     

    1.      Create a ClassLibrary solution.

    2.      Add a user control in the ClassLibrary solution.

    3.      Build this solution.

    4.      Create a Word Add-in solution

    5.      Create a user control in Word add-in solution.

    6.      Right click mouse on the toolbox.

    7.      Add the ClassLibrary solution’s dll file in to the toolbox.

    8.      Add it from the toolbox to user control.

    9.      Create CTP (Customer task pane) in the ThisAddIn_Startup method.

    10.  Right click mouse on solution explorer and publish it.

     

    It works fine on my side. Would you please tell me the different between us?

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 12, 2011 9:38 AM
    Moderator
  • Thanks Tom,

    My Outlook addin project is called DMCEventManagementAddin (NET 3.5 + Visual Studio 2010).My task pane user control is in a user control class TaskPane.I do not wrap my taskpane in a dll, I simply create an instance of it by passing its program id to the taskpane connector:

     

    _taskPaneConnector.CreateTaskPane(
          "DMCEventManagementAddin.TaskPane", "DMC Resources Settings", Globals.ThisAddIn.Application.ActiveInspector());
    
    

     

    Here is the connector code:

     

    public class TaskPaneConnector : Office.Core.ICustomTaskPaneConsumer
     {
      private Office.Core.ICTPFactory _ctpFactory;
    
      internal Microsoft.Office.Core.CustomTaskPane CreateTaskPane(string id, string title, object parentWindow)
      {
       if (_ctpFactory != null)
        return _ctpFactory.CreateCTP(id, title, parentWindow);
    
       return null;
      }
      
      
      // This method is not CLSCompliant because of its Office parameter.
      [CLSCompliant(false)]
      public void CTPFactoryAvailable(
       Office.Core.ICTPFactory CTPFactoryInst)
      {
       // All we need do here is to cache the CTPFactory object, 
       // so that we can create custom taskpanes later on.
       _ctpFactory = CTPFactoryInst;
      }
     }
    

     

    My task pane user control:

     

     

     [
    Guid("E2F1F0E8-254A-4ddc-A500-273D6EFB172B"),
    ProgId("DMCEventManagementAddin.TaskPane"),
    ComVisible(true)
    ]
    
     public partial class TaskPane : UserControl
     {
      AddressList globalAddressList = null;
      AddressEntry DMCResourceBookingEntry = null;
      public TaskPane()
      {
       InitializeComponent();
      }
    
      private void TaskPane_Load(object sender, EventArgs e)
      {
    
      }
     }
    

     

    My addin gets a task pane connector instance from the RequestService method:

    protected override object RequestService(Guid serviceGuid)
        {
          if (serviceGuid ==
            typeof(Microsoft.Office.Core.ICustomTaskPaneConsumer).GUID)
          {
            if (_taskPaneConnector == null)
            {
              _taskPaneConnector = new TaskPaneConnector();
            }
            return _taskPaneConnector;
          }
          return base.RequestService(serviceGuid);
        }

     

    Thank you.


    Wednesday, April 13, 2011 7:40 AM
  • Hi Madani,

     

    The regasm.exe is referred to in your first post, so I think you must create a dll file to store your custom task pane. Would you please create a simple project to reproduce your issue and share it on skydrive for further research?

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 19, 2011 8:20 AM
    Moderator