Microsoft KB Archive/304929

= PRB: Custom MAPI Providers Do Not Load In Outlook 2002 =

Article ID: 304929

Article Last Modified on 8/25/2005

-

APPLIES TO


 * Microsoft Messaging Application Programming Interface
 * Microsoft Outlook 2002 Standard Edition

-



This article was previously published under Q304929



SYMPTOMS
A custom MAPI provider such as an address book provider, transport provider, or message store provider that you have developed may not load in Outlook 2002, even though the provider worked in previous versions of Outlook. You may receive no error messages when Outlook loads.

For example, a custom address book provider that worked in previous versions of Outlook may fail to load in Outlook 2002. The only indication that it did not load is that entries from your provider are not listed when you open the Address Book.



CAUSE
The QueryInterface functions are using two faulty parameter validation macros.



RESOLUTION
To work around this problem, remove the faulty macros from your QueryInterface function. If you want to retain parameter validation, create your own function or macro to handle the validation. Depending on your provider, you may find that other macros with similar names also need to be removed. All macros in MAPI that eventually call HrValidateParameters are potentially affected.

Also, because Outlook now calls QueryInterface on many objects on which QueryInterface was not called before, pay close attention to this function in your transport provider to ensure that it is functioning correctly.



MORE INFORMATION
Many custom providers are based on the samples from Inside MAPI, a Microsoft Press book by De la Cruz and Thaler. These samples use the following macros to validate the parameters that are passed in to QueryInterface functions:
 * CheckParameters_IUnknown_QueryInterface (this, riid, ppvObj);
 * Validate_IUnknown_QueryInterface (this, riid, ppvObj);

These macros always fail, causing QueryInterface to return an error.

These macros were written for C, and do not work correctly in C++. In previous versions of Outlook, this does not cause a problem because QueryInterface on some objects is never called. With the Outlook 2002 version of MAPI, however, this has changed.

Steps to Reproduce Behavior

 * 1) Compile the ABWDS32 sample that is described in Inside MAPI and follow the instructions to install the provider on your test computer.
 * 2) Follow the instructions to install the &quot;WINDS Sample Server Messaging Host&quot; server portion. This sample is located in the Server folder of the book's CD-ROM.
 * 3) Create a profile in Outlook that uses the sample provider.
 * 4) Start Outlook and open the Address Book.
 * 5) In Show Names from the, note that the sample provider is not listed.

