0 out of 1 rated this helpful - Rate this topic

CreateURLMoniker function

Deprecated in Windows Internet Explorer 7. Use CreateURLMonikerEx instead.

Syntax


HRESULT CreateURLMoniker(
  _In_   IMoniker *pMkCtx,
  _In_   LPCWSTR szURL,
  _Out_  IMoniker **ppmk
);

Parameters

pMkCtx [in]

The address of the IMoniker interface for 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 [in]

The address of a string value that contains the display name to be parsed.

ppmk [out]

Pointer to an IMoniker interface for the new URL moniker.

Return value

Returns one of the following values.

Return codeDescription
S_OK

Success.

E_OUTOFMEMORY

The operation ran out of memory.

MK_E_SYNTAX

A moniker cannot be created because szURL does not correspond to valid URL syntax for a full or partial URL. This is uncommon, because most parsing of the URL occurs during binding, and the syntax for URLs is extremely flexible.

 

Remarks

The CreateURLMoniker function creates a URL moniker from a full URL string, or from a base context URL moniker and a partial URL string.

Security Warning:   This function does not correctly interpret percent encoded octets in Windows file paths or "file://" scheme Uniform Resource Identifiers (URIs). On systems with Microsoft Internet Explorer 6 and earlier, calling CreateURLMoniker with the output of a previous call might produce a result that is not equivalent. Since CreateURLMoniker can produce results that are not equivalent to the input, its use can result in security problems.

Use CreateURLMonikerEx with the URL_MK_UNIFORM flag to ensure that Windows file paths and "file://" URIs are 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 CreateURLMoniker, use the PathCreateFromUrl function.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Product

Internet Explorer 3.0

Header

Urlmon.h

Library

Urlmon.lib

DLL

Urlmon.dll

See also

Internet Explorer Blog: CreateURLMoniker Considered Harmful

 

 

Build date: 10/26/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.