none
_FormRegionStartup methods not getting called on 2010 (ATL) RRS feed

  • Question

  • Hi All,

    I have developed a form region that is supposed to work on 2007 and 2010.

    I have implimented every thing in accordance with the following site.

    http://msdn.microsoft.com/en-us/library/ee941475.aspx#BuildingNativeAddinforOL2010_FormRegions

    Every thing works perfectly fine on 2007 and all the methods in _FormRegionStartup get called without any problems. Now when I move this add-in over to 2010 none of the methods for the form region are getting called. Even when I set a break point in the invoke method of the dispatch I do not get the method called.

    The only difference between my add-in and the example is that I am importing the olb's from Outlook 2007 for compatibility reasons. But I have done this with multiple add-ins before with out any issues.

    I think it is something to do with the COM MAP but I have implimented it exactly like the example.

    Any suggestions would be greatly appreciated.

    Thanks,

    Tom

    Wednesday, March 14, 2012 8:46 PM

All replies

  • Hi Tom,

    Thanks for posting in the MSDN Forum.

    I will involve some experts into this issue to see whether they are able to help you. There might be some time delay, thanks for your patience.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, March 15, 2012 2:48 AM
    Moderator
  • thank you
    Thursday, March 15, 2012 1:36 PM
  • Hi Tom,

    Could you please enable ATL query interface tracing?  This would at least verify if Outlook is querying for the _FormRegionStartup interface. If it isn't then the form region addin may not be properly registered.

    To enable ATL query interface tracing please follow the steps below:

    In your stdafx.h file define _ATL_DEBUG_QI above the includes for ATL.  This will output the various QI's that are called by Outlook to the output window.  For more information please see this MSDN article:

    http://msdn.microsoft.com/en-US/library/7067t4w6(v=vs.80).aspx

    Confirm that the QI for the interface _FormRegionStartup (GUID 00063059-0000-0000-C000-000000000046)

     is occurring.

    Dave


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members.
    Monday, March 19, 2012 1:00 PM
  • Hi Dave,

    This is what shows up in the trace for Outlook 2010. Again everything works on 2007.

    BTW - I loaded a couple other extensions with regions for the message IPM and they work without any issues. This region is for contacts.

    CComClassFactory - IUnknown
    CComClassFactory - IClassFactory
    CExt - _IDTExtensibility2
    CExt - _IDTExtensibility2
    CExt - {E19C7100-9709-4DB7-9373-E7B518B47086} - failed
    CExt - IDispatch
    CExt - ICustomTaskPaneConsumer - failed
    CExt - IRibbonExtensibility
    CExt - IDispatch
    CComClassFactory - IUnknown
    CComClassFactory - IClassFactory
    CInboxItemsEvents - IInboxItemsEvents
    CInboxItemsEvents - IInboxItemsEvents
    CInboxItemsEvents - IDispatch

    This is my COM MAP. Same as the web example.

    BEGIN_COM_MAP(CExt)
     COM_INTERFACE_ENTRY2(IDispatch, IRibbonCallback)
     COM_INTERFACE_ENTRY(IExt)
     COM_INTERFACE_ENTRY_IID(DIID_InspectorsEvents, IExt)
     COM_INTERFACE_ENTRY(_FormRegionStartup)
     COM_INTERFACE_ENTRY(AddInDesignerObjects::_IDTExtensibility2)
     COM_INTERFACE_ENTRY(IRibbonExtensibility)
     COM_INTERFACE_ENTRY(IRibbonCallback)
    END_COM_MAP()

     

    Monday, March 19, 2012 3:21 PM
  • Hi Dave,

    I decided to go through my code from top to bottom and see if I could spot anything obvious that would cause an issue. I decided to erase from my mind that the add-in was working on 2007 and concentrate soley on 2010. So looking at the web example I noticed two entries in the rgs file for registering the form region.

    So I originally had...

    NoRemove FormRegions
    {
     'IPM.Contact.jaladdin'
     {
      val jaladdin = s '=jaladdin.Ext'
     }
    }

    AND I switched it to

    NoRemove FormRegions
    {
     'IPM.Contact'
     {
      val jaladdin = s '=jaladdin.Ext'
     }
     'IPM.Contact.jaladdin'
     {
      val jaladdin = s '=jaladdin.Ext'
     }
    }

    Once I did that the Form Region started functioning normally on 2010.

    So most people would say...fine...problem solved. But as my usual self...I asked myself the question why is this working without any issue for my IPM.Note form regions. So I went back and verifed that all my IPM.Note form regions are working with just the one entry as follows.

    NoRemove FormRegions
    {
     'IPM.Note'
     {
      val EASAddin = s '=EASAddin.Ext'
     }
    }

    So I think there are some differences in the registration requirements I believe for Outlook 2007 verses 2010. I believe that Outlook 2007 is more foregiving in the registration requirements.

    Thanks for your help.

    Regards,
    Tom

    Wednesday, March 21, 2012 3:36 PM
  • Hi Tom,

    Thanks for the update and good detective work.  Now if you are using the sample that you reference above which is an adjoining form region that will add the form region to any message class that you list in the registry.  Based on your original registration I would expect that only contact forms with the message class of IPM.Contact.jaladdin would receive the form region.  In the second registration I would expect that contact forms with the message class of IPM.Contact or IPM.Contact.jaladdin would receive your form region.  What confuses me is that you said that Outlook 2007 will add your form region to contact forms with message classes of IPM.Contact when the registration only list form regions for derived forms of IPM.Contact.  Am I reading that correctly?

    Dave


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members.
    Friday, March 23, 2012 1:16 PM
  • Hi Dave,

    Yes you are reading that correctly. Outlook 2007 seems like it is much more forgiving with the registry entries.

    My addin was working fine on Outlook 2007 with the orignal entry I had. I then started testing on Outlook 2010 and the form region interface (_FormRegionStartup) methods were not getting called.

    Tom

    Friday, March 23, 2012 1:42 PM
  • Hi Tom,

    To be clear, the original form region entry for Outlook 2007 you had was:

    NoRemove FormRegions
    {
     'IPM.Note'
     {
      val EASAddin = s '=EASAddin.Ext'
     }
    }

    which would mean that your adjoining form region would be added to all messages with a message class of IPM.Note.

    Dave

    Monday, March 26, 2012 11:45 AM
  • Hi Dave,

    Sorry for the confusion. This was my original registration.

    NoRemove FormRegions
    {
     'IPM.Contact.jaladdin'
     {
      val jaladdin = s '=jaladdin.Ext'
     }
    }

    With that registration the add-in worked on 2007 and did not work on 2010.

    If you have any other questions feel free to fire away.

    Regards,

    Tom

    Monday, March 26, 2012 2:00 PM
  • Thanks Tom.  Let me give this a try on my end.  I am curious to know if I find the same thing.

    Thanks,
    Dave

    Tuesday, March 27, 2012 12:53 PM
  • Hi Tom,

    I didn't find the same thing.  When I created the registration to add an adjoining form region to just contacts with the message class IPM.Contact.jaladin it worked as expected in both Outlook 2007 and Outlook 2010.  I didn't need to create a more generic registration of IPM.Contact as you report for 2010.

    Regards,

    Dave

    Monday, April 23, 2012 8:28 PM
  • Strange!

    I  am getting back to that project in the next couple days for some new features. I will try to duplicate this issue again.

    Monday, April 23, 2012 9:00 PM