Receiving 80040155 (Interface not registered) when requesting IID_IMAPISession RRS feed

  • Question

  • Hi all

    I have a problem when calling QueryInterface(IID_IMAPISession), it is returning 80040155 (Interface not registered).  This is occurring only with Outlook 2013, not with Outlook 2007 or 2010.

    This portion of code is in an out-of-process server.  There are two relevant inputs, both provided by an add-in:
    - LPUNKNOWN p_IUnkSession, which is the MAPI interface
    - LPUNKNOWN p_IUnkApp, which is the Outlook application interface

    I added the code between the comments as a failover to try to get the MAPI session directly from the application object, but have the same result.  In fact, the add-in uses this same code to provide the MAPI session to the out-of-process server, and it works without failure.

        ctx.log("Calling p_IUnkSession->QueryInterface(IID_IMAPISession)");
        ctx.log("   p_IUnkSession = %p", p_IUnkSession);
        if ( FAILED( hr = p_IUnkSession->QueryInterface( IID_IMAPISession, (LPVOID*) &m_p_mapiSession ) ) )
            ctx.log("   failed, hr = %08x", hr);

            Outlook14::_ApplicationPtr outlookApplication = p_IUnkApp;
            Outlook14::_NameSpacePtr outlookMAPISession = NULL;


            IUnknownPtr lpUnkMAPISession = NULL;

            ctx.log("Calling lpUnkMAPISession->QueryInterface(IID_IMAPISession)");
            ctx.log("   lpUnkMAPISession = %p", p_IUnkSession);
            hr = lpUnkMAPISession->QueryInterface(IID_IMAPISession, (void**)&m_p_mapiSession);
            if (FAILED(hr))
                ctx.log("   failed, hr = %08x", hr);
                return hr;

    This is what the log looks like from a 32-bit compilation:

        Calling p_IUnkSession->QueryInterface(IID_IMAPISession)
            p_IUnkSession = 0044FF4C
            failed, hr = 80040155
        Calling lpUnkMAPISession->QueryInterface(IID_IMAPISession)
            lpUnkMAPISession = 0044FF4C
            failed, hr = 80040155

    It does not fail on any of our in-house Outlook 2013 installations, only at our 2013 clients.
    It does not fail in the in-process add-in, only in the out-of-process COM server.
    It does not fail with Outlook 2007 or 2010.

    Is there perhaps an Outlook MAPI DLL that need to be registered, or is the problem closer to my code?

    Many thanks for your insight.

    • Edited by glotter Friday, October 4, 2013 9:32 AM typo
    Wednesday, October 2, 2013 9:39 AM


All replies