Perhaps you can use Stephen Griffin's MAPIStubLibrary in your project. https://github.com/stephenegriffin/MAPIStubLibrary
MAPIInitialize() fails with MS outlook 365
Hi
I have an VC++ application which reads the emails from the MS outlook.
Till now it was working fine till I was using MS outlook 2019/2016.
But as soon as I upgraded my outlook to office 365 app, my application fails with outlook.
below is the code chunk:
LPMAPISESSION m_pSession;
MAPIINIT_0 MAPIINIT = { 0, MAPI_MULTITHREAD_NOTIFICATIONS };
// Initialize MAPI
flags = MAPI_NEW_SESSION | MAPI_USE_DEFAULT;
hr = ::MAPIInitialize(&MAPIINIT);
if (SUCCEEDED(hr))
{
hr = MAPILogonEx(0, NULL, NULL, flags, &m_pSession);
};
The API which is failing is MAPIInitialize(). Now it is returning error code 127 (The specified procedure could not be found.)
Environment is Visual Studio 2019/2022, I tried with both.
Please suggest is there any change in the libraries of MAPI for outlook 365.
32-bit compilation is only I am trying to run, but I did compiled in 64-Bit, there I was getting the error "fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'". So I switched back to 32bit. Any idea how to get rid of this error in 64 bit compilation?
Kindly help, my application has stopped working and need guidance.
Thanks in advance.