When a client application calls MAPILogonEx to begin a session using a profile that contains your address book provider, MAPI loads your provider and all others that are part of the profile. MAPI learns of the name of your provider's entry point function by looking in the profile. Remember that this function is not the same as a DLL entry point function; see the documentation for DllEntryPoint in the Win32 documentation.
There are several entries, some of which must appear in the MAPISVC.INF configuration file, that are included in the profile section of every address book provider. The following table lists these profile section entries and whether or not the MAPISVC.INF file must include them.
Profile section entry | MAPISVC.INF requirement |
---|---|
PR_DISPLAY_NAME=string | Optional |
PR_PROVIDER_DISPLAY=string | Required |
PR_PROVIDER_DLL_NAME=DLL filename | Required |
PR_RESOURCE_TYPE=long | Required |
PR_RESOURCE_FLAGS=bitmask | Optional |
Your address book provider can place this information into a profile directly by calling its profile section's IMAPIProp::SetProps method or indirectly by modifying MAPISVC.INF. Profiles are built using the relevant information in MAPISVC.INF for the selected service providers or message services. For more information about the organization and contents of MAPISVC.INF, see File Format of MAPISVC.INF.
The name of your address book provider's DLL entry point function must be ABProviderInit and it must conform to the ABProviderInit prototype. Perform the following tasks in your provider's DLL entry point function:
Do not call either MAPIInitialize or MAPIUninitialize in this function.
The DLL entry point function instantiates a provider object and returns to MAPI a pointer to that object.