Share via


CreateURLMonikerEx function

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

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Use CreateURLMonikerEx with the URL_MK_UNIFORM flag to ensure that a 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.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Product

Internet Explorer 5.5

Header

Urlmon.h

Library

Urlmon.lib

DLL

Urlmon.dll

See also

CreateURLMonikerEx2