Linking to the MAPI DLLs

MAPI clients can link to the MAPI DLLs implicitly or explicitly through the Windows functions LoadLibrary and GetProcAddress.

MAPI provides type definition statements in the MAPIX.H header file for each of the following functions:

MAPILogonEx

MAPIUninitialize

MAPIInitialize

MAPIAllocateBuffer

MAPIAllocateMore

MAPIFreeBuffer

MAPIAdminProfiles

Use these type definitions to correctly call the corresponding entry points if you link explicitly to the MAPI DLLs.

Service providers can contain non-MAPI functionality — features that are completely unrelated to MAPI — in their DLL. If you need to use these features, call LoadLibrary before using the DLL and FreeLibrary to remove the DLL from memory after its use. Because MAPI is unaware of non-MAPI uses of a service provider DLL, there is no guarantee that the DLL will be available when needed. MAPI releases a service provider DLL when there are no longer any clients with active sessions that require its services.