|
IMoniker::Reduce
Returns a reduced moniker; that is, another moniker that refers to the same
object as this moniker but can be bound with equal or greater efficiency.
HRESULT Reduce(
IBindCtx *pbc,
| //Bind context to be used
| DWORD dwReduceHowFar,
| //How much reduction should be done
| IMoniker **ppmkToLeft,
| //Moniker to the left in the composite
| IMoniker **ppmkReduced
| //Receives the reduced moniker
| );
|
|
Parameters
pbc
[in] Points to the bind context to be used in this binding operation. The bind
context caches objects bound during the binding process, contains parameters
that apply to all operations using the bind context, and provides the means by
which the moniker implementation should retrieve information about its
environment. For more information, see IBindCtx.
dwReduceHowFar
[in] Specifies how far this moniker should be reduced. This parameter must be
one of the values from the MKRREDUCE enumeration. For more information on the MKRREDUCE enumeration, see the "Data Structures" section.
ppmkToLeft
[in, out] On entry, *ppmkToLeft points to the moniker to the left of this moniker, if this moniker is part of
a composite. This parameter is primarily used by moniker implementors to
enable cooperation between the various components of a composite moniker; moniker
clients can usually pass NULL.
On exit, *ppmkToLeft is usually set to NULL, indicating no change in the original moniker to the
left. In rare situations *ppmkToLeft is set to non-NULL, indicating that the previous moniker to the left should
be disregarded and the moniker returned through *ppmkToLeft is the replacement. In such a situation, the implementation must call IUnknown::Release on the passed-in pointer and call IUnknown::AddRef on the returned moniker; the caller must release it later. If an error
occurs, the implementation can either leave the parameter unchanged or set it to
NULL.
ppmkReduced
[out] Receives a pointer to the reduced form of this moniker, which can be
NULL if an error occurs or if this moniker is reduced to nothing. If this moniker
cannot be reduced, *ppmkReduced is simply set to this moniker and the return value is MK_S_REDUCED_TO_SELF.
If ppmkReduced is non-NULL, the implementation must call IUnknown::AddRef on the parameter; it is the caller's responsibility to call IUnknown::Release. (This is true even if *ppmkReduced is set to this moniker.)
Return Values
S_OK
Indicates that this moniker was reduced.
MK_S_REDUCED_TO_SELF
Indicates that this moniker could not be reduced any further, in which case, *ppmkReduced is this moniker.
MK_E_EXCEEDEDDEADLINE
Indicates that the operation could not be completed within the time limit
specified by the bind context's BIND_OPTS structure.
E_UNEXPECTED
Indicates an unexpected error.
E_OUTOFMEMORY
Indicates insufficient memory.
Comments
The IMoniker::Reduce method is intended for the following uses:
- It enables the construction of user-defined macros or aliases as new kinds of
moniker classes. When reduced, the moniker to which the macro evaluates is
returned.
- It enables the construction of a kind of moniker that tracks data as it moves
about. When reduced, the moniker of the data in its current location is
returned.
- On file systems that support an ID-based method of accessing files which is
independent of file names; a file moniker could be reduced to a moniker which
contains one of these IDs.
The intent of the MKRREDUCE flags passed in the dwReduceHowFar parameter is to provide the ability to programmatically reduce a moniker to a
form whose display name is recognizable to the user. For example, paths in the
file system, bookmarks in word-processing documents, and range names in
spreadsheets are all recognizable to users. In contrast, a macro or an alias
encapsulated in a moniker are not recognizable to users.
Notes to Callers
The scenarios described above are not currently implemented by the
system-supplied moniker classes.
You should call IMoniker::Reduce before comparing two monikers using the IMoniker::IsEqual method, because a reduced moniker is in its most specific form. IMoniker::IsEqual may return S_FALSE on two monikers before they are reduced and return S_OK
after they are reduced.
Notes to Implementors
If the current moniker can be reduced, your implementation must not reduce the
moniker in-place. Instead, it must return a new moniker that represents the
reduced state of the current one. This way, the caller still has the option of
using the non-reduced moniker (for example, enumerating its components). Your
implementation should reduce the moniker at least as far as is requested.
See Also
IMoniker::IsEqual, MKRREDUCE
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|