IUri::GetPropertyBSTR method

Returns the specified Uniform Resource Identifier (URI) property value in a new BSTR.

Syntax

HRESULT GetPropertyBSTR(
  [in]  Uri_PROPERTY uriProp,
  [out] BSTR         *pbstrProperty,
  [in]  DWORD        dwFlags
);

Parameters

uriProp [in]

A value from the Uri_PROPERTY enumeration.

pbstrProperty [out]

Address of a BSTR that receives the property value.

dwFlags [in]

One of the following property-specific flags, or zero.

Uri_DISPLAY_NO_FRAGMENT (0x00000001)

Uri_PROPERTY_DISPLAY_URI: Exclude the fragment portion of the URI, if any.

Uri_PUNYCODE_IDN_HOST (0x00000002)

Uri_PROPERTY_ABSOLUTE_URI, Uri_PROPERTY_DOMAIN, Uri_PROPERTY_HOST: If the URI is an IDN, always display the hostname encoded as punycode.

Uri_DISPLAY_IDN_HOST (0x00000004)

Uri_PROPERTY_ABSOLUTE_URI, Uri_PROPERTY_DOMAIN, Uri_PROPERTY_HOST: Display the hostname in punycode or Unicode as it would appear in the Uri_PROPERTY_DISPLAY_URI property.

Return value

Returns one of the following values:

Return code Description
S_OK

Success.

S_FALSE

The property is not defined.

E_INVALIDARG

Property value is not a string.

E_OUTOFMEMORY

There is insufficient memory to create the BSTR.

 

Remarks

IUri::GetPropertyBSTR was introduced in Windows Internet Explorer 7.

The uriProp parameter must be a string property. This method will fail if the specified property isn't a BSTR property.

The pbstrProperty parameter will be set to a new BSTR containing the value of the specified string property. The caller should use SysFreeString to free the string.

This method will return S_FALSE and set pbstrProperty to an empty string if the URI doesn't contain the specified property.

Requirements

Minimum supported client

Windows XP with SP2

Minimum supported server

Windows Server 2003 with SP1

Product

Internet Explorer 7

Header

Urlmon.h

IDL

Urlmon.idl

DLL

Urlmon.dll

See also

IUri

Reference

GetAbsoluteUri

GetAuthority

GetDisplayUri

GetDomain

GetExtension

GetFragment

GetHost

GetPassword

GetPath

GetPathAndQuery

GetPropertyDWORD

GetQuery

GetRawUri

GetSchemeName

GetUserInfo

GetUserName