Export (0) Print
Expand All
Expand Minimize
0 out of 5 rated this helpful - Rate this topic

InternetCreateUrl function

Creates a URL from its component parts.

Syntax


BOOL InternetCreateUrl(
  _In_     LPURL_COMPONENTS lpUrlComponents,
  _In_     DWORD dwFlags,
  _Out_    LPTSTR lpszUrl,
  _Inout_  LPDWORD lpdwUrlLength
);

Parameters

lpUrlComponents [in]

Pointer to a URL_COMPONENTS structure that contains the components from which to create the URL.

dwFlags [in]

Controls the operation of this function. This parameter can be one or more of the following values.

ValueMeaning
ICU_ESCAPE

Converts all unsafe characters to their corresponding escape sequences in the path string pointed to by the lpszUrlPath member and in lpszExtraInfo the extra-information string pointed to by the member of the URL_COMPONENTS structure pointed to by the lpUrlComponents parameter.

The Unicode version of InternetCreateUrl will first try to convert using the system code page. If that fails it falls back to UTF-8.

ICU_USERNAME

Obsolete — ignored.

 

lpszUrl [out]

Pointer to a buffer that receives the URL.

lpdwUrlLength [in, out]

Pointer to a variable that specifies the size of the URLlpszUrl buffer, in TCHARs. When the function returns, this parameter receives the size of the URL string, excluding the NULL terminator. If GetLastError returns ERROR_INSUFFICIENT_BUFFER, this parameter receives the number of bytes required to hold the created URL.

Return value

Returns TRUE if the function succeeds, or FALSE otherwise. To get extended error information, call GetLastError.

Remarks

When specifying scheme in the URL_COMPONENTS structure passed to lpUrlComponents, if lpszScheme is not NULL it will be used for the scheme. If lpszScheme is NULL, the scheme can be specified using the INTERNET_SCHEME enumeration by setting nScheme to the required INTERNET_SCHEME or INTERNET_SCHEME_DEFAULT.

Note  WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use Microsoft Windows HTTP Services (WinHTTP).

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Wininet.h

Library

Wininet.lib

DLL

Wininet.dll

Unicode and ANSI names

InternetCreateUrlW (Unicode) and InternetCreateUrlA (ANSI)

See also

Handling Uniform Resource Locators
WinINet Functions

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.