none
VC++ Outlook 2013 Addin creation and deployment RRS feed

  • Question

  • Hi Guys,

    I am new to VC++ . I have some queries:

    1) I need to created and deploy outlook 2013 Addin using VC++ . Please help me with any sample tutorial.

    2) I have outlook plugin code that was developed using vc++. It supports outlook 2007,2012. I need to upgrade it so that i can support outlook 2013. Please let me know how to start on this project.

    Regards,

    Samira

    Wednesday, May 7, 2014 8:07 AM

Answers

  • Hi Samira,

    You just need to call the Outlook object model properties and methods on the main thread. You are free to run background threads without Outlook objects. So, you can get the value on the main thread and save it to a variable which you can use in another threads.

    What exactly do you want to fix?


    Thursday, May 15, 2014 12:09 PM

All replies

  • Hello Samira,

    Do you develop an unmanaged add-in for Outlook?

    If so, please take a look at the Outlook 2010: Building a C++ Add-In sample add-in project. Also see Building a C++ Add-in for Outlook 2010 article in MSDN. Also you may find the How To Automate Outlook Using Visual C++/MFC article helpful.

    Your add-in should implement IDTExtensibity2 interface. That's all. Did you try to register it for Outlook 2013?

    Wednesday, May 7, 2014 11:49 AM
  • Hi Eugene,

    Can you let me know how to register for Outlook 2013 and how can we build the release for both 32 bit and 64 bit.

    Regards,

    Samira

    Thursday, May 8, 2014 6:02 AM
  • There is no difference in registering COM add-ins between previous Outlook versions and 2013. See Registry Entries for Application-Level Add-Ins article in MSDN for more information. You just need to set the target platform of your add-in to x86 for Outlook 2013 x86 and x64 for Outlook 2013 x64.
    Thursday, May 8, 2014 9:53 AM
  • Hi Eugene,

    This is my code for background syncing. At this line i am getting the exception  "if (!theApp->Session->Offline)" that the "The application called an interface that was marshalled for a different thread."

    This exception is coming in only outlook 2013. This code is working fine in outlook 2010 and 2007 .Please help me with this


    Regards,

    Samira


    Wednesday, May 14, 2014 1:09 PM
  • Hello Samira,

    Do you cal the Outlook object model from secondary threads?

    Be aware, Office applications use single threaded apartments. You shouldn't work with Outlook object model in another threads.



    Wednesday, May 14, 2014 1:54 PM
  • That should be "you should NOT work with the object model from background threads".

    Outlook 2013 takes special measures to prevent the object model from being called from a background thread. Older versions just crash or hang.


    Ken Slovak MVP - Outlook

    Wednesday, May 14, 2014 2:21 PM
    Moderator
  • Exactly. It was a syntax mistake. I have just corrected the post.
    Wednesday, May 14, 2014 2:34 PM
  • Hi Kev,

    I have commented this below code

    Outlook::_ApplicationPtr theApp = pApplication;
        if(!theApp->Session->Offline)

    and now background thread is not crashing. This code was inside the sync function that is called by background thread.

    how can i fix this. Plz help.

    Regards,

    Samira

    Thursday, May 15, 2014 11:50 AM
  • Hi Samira,

    You just need to call the Outlook object model properties and methods on the main thread. You are free to run background threads without Outlook objects. So, you can get the value on the main thread and save it to a variable which you can use in another threads.

    What exactly do you want to fix?


    Thursday, May 15, 2014 12:09 PM
  • In an Outlook addin using the Outlook object model you must use all object model calls plus all user interface operations in the main thread, which is the thread Outlook uses.

    Background threads can be used for other operations as long as they don't involve the object model or the UI. Any calls to the object model or the UI must be marshaled to the main thread.

    You can use Extended MAPI from a background thread. You need to set up your login and session correctly for running in the background, but it can be done.

    Another alternative would be a 3rd party library that wraps Extended MAPI in a COM wrapper, Redemption (www.dimastr.com/redemption). That library takes care of the messy MAPI details and provides an object model to use. I use it all the time for many things, including operations from background threads.


    Ken Slovak MVP - Outlook

    Thursday, May 15, 2014 3:02 PM
    Moderator