Export (0) Print
Expand All
Expand Minimize

InternetCombineUrl function

Combines a base and relative URL into a single URL. The resultant URL is canonicalized (see InternetCanonicalizeUrl).

Syntax


BOOL InternetCombineUrl(
  _In_     LPCTSTR lpszBaseUrl,
  _In_     LPCTSTR lpszRelativeUrl,
  _Out_    LPTSTR lpszBuffer,
  _Inout_  LPDWORD lpdwBufferLength,
  _In_     DWORD dwFlags
);

Parameters

lpszBaseUrl [in]

Pointer to a null-terminated string that contains the base URL.

lpszRelativeUrl [in]

Pointer to a null-terminated string that contains the relative URL.

lpszBuffer [out]

Pointer to a buffer that receives the combined URL.

lpdwBufferLength [in, out]

Pointer to a variable that contains the size of the lpszBuffer buffer, in characters. If the function succeeds, this parameter receives the size of the combined URL, in characters, not including the null-terminating character. If the function fails, this parameter receives the size of the required buffer, in characters (including the null-terminating character).

dwFlags [in]

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

ValueMeaning
ICU_BROWSER_MODE

Does not encode or decode characters after "#" or "?", and does not remove trailing white space after "?". If this value is not specified, the entire URL is encoded and trailing white space is removed.

ICU_DECODE

Converts all %XX sequences to characters, including escape sequences, before the URL is parsed.

ICU_ENCODE_PERCENT

Encodes any percent signs encountered. By default, percent signs are not encoded. This value is available in Microsoft Internet Explorer 5 and later.

ICU_ENCODE_SPACES_ONLY

Encodes spaces only.

ICU_NO_ENCODE

Does not convert unsafe characters to escape sequences.

ICU_NO_META

Does not remove meta sequences (such as "." and "..") from the URL.

 

Return value

Returns TRUE if successful, or FALSE otherwise. To get extended error information, call GetLastError. Possible errors include the following.

Return codeDescription
ERROR_BAD_PATHNAME

The URLs could not be combined.

ERROR_INSUFFICIENT_BUFFER

The buffer supplied to the function was insufficient or NULL. The value indicated by the lpdwBufferLength parameter will contain the number of bytes required to hold the combined URL.

ERROR_INTERNET_INVALID_URL

The format of the URL is invalid.

ERROR_INVALID_PARAMETER

There is an invalid string, buffer, buffer size, or flags parameter.

 

Remarks

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

InternetCombineUrlW (Unicode) and InternetCombineUrlA (ANSI)

See also

Handling Uniform Resource Locators
WinINet Functions

 

 

Show:
© 2014 Microsoft