PRB: Custom MAPI Providers Do Not Load In Outlook 2002 (304929)



The information in this article applies to:

  • Microsoft Extended Messaging Application Programming Interface (MAPI)
  • Microsoft Outlook 2002

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 "WINDS Sample Server Messaging Host" 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.

REFERENCES

De la Cruz, Irving, and Les Thaler. Inside MAPI. Redmond: Microsoft Press, 1996.

Modification Type:MinorLast Reviewed:8/25/2005
Keywords:kbMsg kbprb KB304929