Performs a generic composition of two monikers and supplies a pointer to the resulting composite moniker.
WINOLEAPI CreateGenericComposite(
LPMONIKER pmkFirst, //Pointer to the first moniker
LPMONIKER pmkRest, //Pointer to the second moniker
LPMONIKER FAR *ppmkComposite
//Address of output variable that receives the
// IMoniker interface pointer
);
This function supports the standard return value E_OUTOFMEMORY, as well as the following:
CreateGenericComposite joins two monikers into one. The moniker classes being joined can be different, subject only to the rules of composition. Call this function only if you are writing a new moniker class by implementing the IMoniker interface, within an implementation of IMoniker::ComposeWith that includes generic composition capability.
Moniker providers should call IMoniker::ComposeWith to compose two monikers together. Implementations of ComposeWith should (as do OLE implementations) attempt, when reasonable for the class, to perform non-generic compositions first, in which two monikers of the same class are combined. If this is not possible, the implementation can call CreateGenericComposite to do a generic composition, which combines two monikers of different classes, within the rules of composition. You can define new types of non-generic compositions if you write a new moniker class.
During the process of composing the two monikers, CreateGenericComposite makes all possible simplifications. Consider the example where pmkFirst is the generic composite moniker, A + B + C, and pmkRest is the generic composite moniker, C (-1) + B (-1) + Z (where C (-1) is the inverse of C). The function first composes C to C (-1) , which composes to nothing. Then it composes B and B (-1) to nothing. Finally, it composes A to Z, and supplies a pointer to the generic composite moniker, A + Z.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in objbase.h.
Import Library: Included as a resource in ole32.dll.
IMoniker::ComposeWith, IMoniker - Generic Composite Moniker Implementation