CreateGenericComposite
Performs a generic composition of
pmkFirst and
pmkRest and returns the resulting moniker.
WINOLEAPI CreateGenericComposite(
LPMONIKER pmkFirst,
| //First moniker
|
LPMONIKER pmkRest,
| //Second moniker
|
LPMONIKER FAR *ppmkComposite
| //Receives the composite
|
);
|
|
Parameters
pmkFirst
Points to the moniker to be composed to the left of the
pmkRest moniker. Can point to any kind of moniker, including a generic composite.
pmkRest
Points to the moniker to be composed to the right of the
pmkFirst moniker. Can point to any kind of moniker, including a generic composite.
ppmkComposite
Receives an
IMoniker pointer to the moniker that is the result of composing
pmkFirst and
pmkRest. If either
pmkFirst or
pmkRest are NULL, the returned pointer is the one that is non-NULL. If both
pmkFirst and
pmkRest are NULL, or if an error occurs, the returned pointer is NULL. If the
returned pointer is non-NULL, the function has called
IUnknown::AddRef on the parameter and the caller is responsible for calling
IUnknown::Release.
Return Values
S_OK
Indicates the two input monikers were successfully composed.
MK_E_SYNTAX
Indicates the two monikers could not be composed due to an error in the syntax
of a path (for example, if both
pmkFirst and
pmkRest are file monikers based on absolute paths).
E_OUTOFMEMORY
Indicates insufficient memory.
Comments
You would call this function only if you are writing your own moniker class
(implementing the
IMoniker interface). If you want to perform a generic composition in your
implementation of the
IMoniker::ComposeWith method, call this function from there.
Composition is the process of joining two monikers together. Sometimes two
monikers of specific classes can be combined; for example, a file moniker
representing an incomplete path and another file moniker representing a relative path
can be combined to form a single file moniker representing the complete path.
This is an example of "non-generic" composition. "Generic" composition, on the
other hand, can connect any two monikers, no matter what their classes. Because a
non-generic composition depends on the class of the monikers involved, it can
be done only in the implementation of the
IMoniker::ComposeWith method for a particular class. You can define new types of non-generic
compositions if you write a new moniker class. In contrast, it is only necessary to
call the CreateGenericComposite for generic compositions.
If you are a moniker client and you need to compose two monikers together, you
should call the
IMoniker::ComposeWith method. This gives the first moniker a chance to perform a non-generic
composition. The only time you should call
CreateGenericComposite is if you are writing a new moniker class. In the implementation of
IMoniker::ComposeWith, you should call
CreateGenericComposite once you have determined that your implementation cannot do a non-generic
composition.
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 returns a pointer to the generic composite moniker,
A (
)
Z.
See Also
IMoniker::ComposeWith,
IMoniker - Generic Composite Moniker Implementation
- Software for developers
-
Delphi Components
.Net Components
Software for Android Developers
- More information resources
-
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
- Databases for Amazon shops developers
-
Amazon Categories Database
Browse Nodes Database