Objects and Interfaces

A MAPI object is a C++ object class or C data structure inherited from one or more MAPI interfaces, or collections of related functions. These collections of related functions are known to C++ developers as pure virtual functions. For a pure virtual function, MAPI supplies only the function prototype, not an implementation. It is expected that a client application, a service provider, or MAPI will provide this implementation by creating an object class inherited from the interface and conforming to the function descriptions documented in the MAPI Programmer's Reference. A MAPI interface can only be instantiated through an inherited class.

There are many different MAPI objects, each object inheriting from an interface that is ultimately inherited from IUnknown. IUnknown is the OLE Component Object Model (COM) base interface. It provides MAPI objects with a standard mechanism for communication and control. The Component Object Model dictates how object implementers handle issues such as memory management, parameter management, and multithreading. By conforming to this model, an object implementer adheres to a contract as specified by the interfaces included in the object.

Many MAPI interfaces are inherited directly from IUnknown while others are inherited indirectly through one of two other base interfaces: IMAPIProp for property management and IMAPIContainer for folder and address book access. Base interfaces are never implemented as separate, standalone objects; they are always implemented as part of other objects, objects that implement derived interfaces.

MAPI defines many types of objects, each implemented by one or more MAPI components. Objects implemented by clients are used by MAPI, by service providers, and by custom form components. Objects implemented by service providers are typically used by MAPI and by clients. Objects implemented by form library providers and form servers are used by other form components and by clients.