One way to incorporate the MAPI Stub Library is to copy the source files, MapiStubLibrary.cpp and StubUtils.cpp directly into your project and remove any linkage to mapi32.lib as well as any code which explicitly links to MAPI. MFCMAPI, which formerly implemented Explicit Linking to link to MAPI, uses this technique. If you're not already including msi.lib, you will need to either include it or manually load the MSI functions.

Since the MAPI Stub Library implements all of the logic for loading MAPI for you, in MFCMAPI we were able to eliminate a large amount of code from ImportProcs.cpp which had previously handled locating MAPI and finding entry points to MAPI functions. A couple features in MFCMAPI changed during this integration, such as:

Aside from including the source files as part of your build and adding msi.lib, there are no changes required to your code which makes MAPI calls.