IBindHost::CreateMoniker

Provides the caller with a means to turn text string into a moniker such that the caller does not have to interpret the name in any way itself. In many cases, the implementation of IBindHost::CreateMoniker will simply call MkParseDisplayNameEx, but this method gives the implementor of IBindHost a chance to catch host-specific strings that MkParseDisplayNameEx would not otherwise recognize. Specifically, IBindHost::CreateMoniker should resolve relative path names into absolute pathnames when interpreting the pszName.

HRESULT CreateMoniker(

LPOLESTR pszName,

//Pointer to the string to parse

IMoniker ** ppmk

//Indirect pointer to the IMoniker interface for the new moniker

);

Parameters

pszName
[in] Pointer to the string containing the name to parse.
ppmk
[out] Indirect pointer to IMoniker interface for the moniker created from pszName. The caller is responsible for calling IMoniker::Release when the moniker is no longer needed.

Return Values

S_OK
The moniker was successfully obtained and the caller is responsible for the interface pointer.
E_OUTOFMEMORY
There is insufficient memory to create the moniker.
E_UNEXPECTED
An unexpected error occurred.
MK_E_SYNTAX
The bind host was unable to parse the string into a moniker because the information in the name was unrecognizable.

Remarks

E_NOTIMPL is not allowed &emdash; a bind host is responsible for providing moniker parsing services.