Creates a URL moniker from a full URL, or from a base context URL moniker and a partial URL.
Syntax
HRESULT CreateURLMonikerEx(
IMoniker *pMkCtx,
LPCWSTR szURL,
IMoniker **ppmk,
DWORD dwFlags
);
Parameters
- pMkCtx
-
A pointer to an IMoniker interface of the URL moniker to use as the base context when the szURL parameter is a partial URL string. The pMkCtx parameter can be NULL.
- szURL
-
A string value that contains the URL to be parsed.
- ppmk
-
A pointer to an IMoniker interface for the new URL moniker.
- dwFlags
-
A DWORD value that specifies which URL parser to use. This can be one of the following values.
URL_MK_LEGACY- Use the same URL parser as CreateURLMoniker.
URL_MK_UNIFORM- Use the updated URL parser.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
Use CreateURLMonikerEx with the URL_MK_UNIFORM flag to ensure that a Microsoft Windows file path and "file://" Uniform Resource Identifier (URI) is interpreted correctly with regard to percent encoded octets, and that the result is equivalent to the input. To correctly extract a Windows file path from the result of CreateURLMonikerEx, use PathCreateFromUrl.
For compatibility reasons, it might be possible to create a URL moniker from an invalid URL; however, such a base moniker cannot be combined with a relative URL. Any attempt to do so will fail with E_INVALIDARG.
Function Information
| Stock Implementation | urlmon.dll |
|---|
| Custom Implementation | No |
|---|
| Header | urlmon.h |
|---|
| Import library | urlmon.lib |
|---|
| Minimum availability | Internet Explorer
5.5 |
|---|
| Minimum operating systems |
Windows 95, Windows NT 4.0 |
|---|
See Also
CreateURLMonikerEx2