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.
Value Meaning - 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 code | Description |
|---|---|
|
The URLs could not be combined. |
|
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. |
|
The format of the URL is invalid. |
|
There is an invalid string, buffer, buffer size, or flags parameter. |
Remarks
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
InternetCombineUrlW (Unicode) and InternetCombineUrlA (ANSI) |
See also