This method requests an object’s moniker.
At a Glance
Header file: | Oleidl.h |
Windows CE versions: | 2.0 and later |
Syntax
HRESULT GetMoniker( DWORD dwAssign, DWORD dwWhichMoniker,
IMoniker ** ppmk );
Parameters
dwAssign
[in] Determines how the moniker is assigned to the object. Depending on the value of dwAssign, IOleObject::GetMoniker does one of the following:
Values for dwAssign are specified in the enumeration OLEGETMONIKER.
You cannot pass OLEGETMONIKER_UNASSIGN when calling IOleObject::GetMoniker. This value is valid only when calling IOleClientSite::GetMoniker.
dwWhichMoniker
[in] Specifies the form of the moniker being requested. Valid values are taken from the enumeration OLEWHICHMK.
ppmk
[out] Address of IMoniker* pointer variable that receives the interface pointer to the object’s moniker. If an error occurs, *ppmk must be set to NULL. Each time an object receives a call to GetMoniker, it must increase the reference count on *ppmk. It is the caller’s responsibility to call Release when it is done with *ppmk.
Return Values
This method supports the standard return values E_FAIL and E_UNEXPECTED, as well as the values described in the following table.
Value | Description |
S_OK | Requested moniker returned successfully. |
E_NOTIMPL | This container cannot assign monikers to objects. This is the case with OLE 1 containers. |
Remarks
The IOleObject::GetMoniker method returns an object’s moniker. Like IOleObject::SetMoniker, this method is important only in the context of managing links to embedded objects and even in that case is optional. A potential link client that requires an object’s moniker to bind to the object can call this method to obtain that moniker. The default implementation of IOleObject::GetMoniker calls the IOleClientSite::GetMoniker, returning E_UNEXPECTED if the object is not running or does not have a valid pointer to a client site.