InternetCombineUrlW function (wininet.h)
Combines a base and relative URL into a single URL. The resultant URL is canonicalized (see InternetCanonicalizeUrl).
Syntax
BOOL InternetCombineUrlW(
[in] LPCWSTR lpszBaseUrl,
[in] LPCWSTR lpszRelativeUrl,
[out] LPWSTR lpszBuffer,
[in, out] LPDWORD lpdwBufferLength,
[in] DWORD dwFlags
);
Parameters
[in] lpszBaseUrl
Pointer to a null-terminated string that contains the base URL.
[in] lpszRelativeUrl
Pointer to a null-terminated string that contains the relative URL.
[out] lpszBuffer
Pointer to a buffer that receives the combined URL.
[in, out] lpdwBufferLength
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).
[in] dwFlags
Controls the operation of the function. This parameter can be one of the following values.
Value | Meaning |
---|---|
|
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. |
|
Converts all %XX sequences to characters, including escape sequences, before the URL is parsed. |
|
Encodes any percent signs encountered. By default, percent signs are not encoded. This value is available in Microsoft Internet Explorer 5 and later. |
|
Encodes spaces only. |
|
Does not convert unsafe characters to escape sequences. |
|
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
Note
The wininet.h header defines InternetCombineUrl as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | wininet.h |
Library | Wininet.lib |
DLL | Wininet.dll |