none
Outlook 2010 - MAPI Headers RRS feed

  • Question

  • Hi,

    I am using an Outlook 2010 addin using VS 2010 and C# and VC++ 2010 class libraries. My target is to deploy this to Outlook 2010 64 bit.

    The VC++ project using mapi32.dll using DLL import in C# and a call to VC++ project. I am using methods like HrGetOneProp@12, HrSetOneProp@8 and MAPIFreeBuffer@4.

    This works fine in Outlook 2010 32 bit but fails for Outlook 2010 64 bit saying the "Could not find entry point for HrGetOneProp@12 in mapi32.lib".

    I did a search on net and it seems like that i have to download Outlook 2010 - MAPI headers which i did and the zip file has extracted 18 header files on my machine. My question is what should i do now ?

    I have 3 versions of mapi32.lib file on my machine in Lib folder in Windows SDK. Should i replace all of these header files with the ones i downloaded ?

    Do i need to do something else as well ?

    Thanks


    Kulvinder Singh
    Wednesday, March 16, 2011 12:25 PM

Answers

  • Hi,

    in your comimports, try removing the @123 stack corrections, they're only valid in x86, e.g.:

    [DllImport("MAPI32.DLL", CharSet = CharSet.Ansi, EntryPoint = "HrGetOneProp")]
    public static extern void HrGetOneProp(IntPtr pmp, uint ulPropTag, out IntPtr ppprop);
    
    

     

    David

    Thursday, March 17, 2011 11:01 AM

All replies

  • I had already gone through the links you have quoted but they are not very clear on what needs to be done. If you read my problem above, i have already done what was suggested. Still no luck. Still getting the same error.

    Any other ideas.


    Kulvinder Singh
    Wednesday, March 16, 2011 4:37 PM
  • How the 18 header files (Outlook 2010- MAPI headers) is related to mapi32.lib file ?

    Can you simply describe the process to be followed which can help us overcome the issue ?


    Kulvinder Singh
    Wednesday, March 16, 2011 4:45 PM
  • Hi,

    in your comimports, try removing the @123 stack corrections, they're only valid in x86, e.g.:

    [DllImport("MAPI32.DLL", CharSet = CharSet.Ansi, EntryPoint = "HrGetOneProp")]
    public static extern void HrGetOneProp(IntPtr pmp, uint ulPropTag, out IntPtr ppprop);
    
    

     

    David

    Thursday, March 17, 2011 11:01 AM
  • Are you sure that just removing the stack codes will work for Outlook 64 bit ?
    Kulvinder Singh
    Thursday, March 17, 2011 11:03 AM
  • Are you sure that just removing the stack codes will work for Outlook 64 bit ?
    Kulvinder Singh


    It's working here like this for hrgetoneprop, mapifreebuffer and hrsetoneprop.

    David

    Thursday, March 17, 2011 11:58 AM
  • You are absolutely correct. Thanks a lot for your help.

    Kulvinder Singh
    Thursday, March 17, 2011 12:35 PM
  • Hello,


    I had the same problem and I have resolved it with your help. But I have one question: can we write "universal" code which would work in x86 and x64 platforms? Because now (if I try use the same code for x86 platform) I obtain the same error, so I can't just remove "the @123 stack corrections".

    Thank you in advance.


    Maxim
    Monday, June 27, 2011 9:41 AM
  • Hi,

    I have used 2 sets of classes to import same methods with different entry points for x86 and x64. You may use that way as well.

    Hope this helps.

    Cheers


    Kulvinder Singh
    Monday, June 27, 2011 9:55 AM
  • C# code (or VB.NET code) can be compiled as "Any" and will run with no problems in both x86 and x64 addins. However, C++ code would have to be compiled separately for either processor and used with a processor with the appropriate "bitness".

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Maxim Alexandrovich" <=?utf-8?B?TWF4aW0gQWxleGFuZHJvdmljaA==?=> wrote in message news:10e7bc1e-df60-44ee-a949-b90a0d05af91...

    Hello,


    I had the same problem and I have resolved it with your help. But I have one question: can we write "universal" code which would work in x86 and x64 platforms? Because now (if I try use the same code for x86 platform) I obtain the same error, so I can't just remove "the @123 stack corrections".

    Thank you in advance.


    Maxim

    Ken Slovak MVP - Outlook
    Monday, June 27, 2011 1:30 PM
  • Are you sure that just removing the stack codes will work for Outlook 64 bit ?


    Kulvinder Singh


    It's working here like this for hrgetoneprop, mapifreebuffer and hrsetoneprop.

    David

    Thank you for this.  It worked for me with the above two and MAPIFreeBuffer as well.  It took ages of searching to find this info and it has completely solved my issue.
    Thursday, February 20, 2014 3:28 AM