Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Combines a base and relative URL into a single URL. The resultant URL will be canonicalized (see InternetCanonicalizeUrl).
Syntax
BOOL InternetCombineUrl%( IN LPCTSTR% lpszBaseUrl, IN LPCTSTR% lpszRelativeUrl, OUT LPTSTR% lpszBuffer, IN OUT LPDWORD lpdwBufferLength, IN DWORD dwFlags );The actual syntax of this function varies between its ANSI and Unicode implementations. See the Win32 Internet Functions Syntax document for details.
Parameters
- lpszBaseUrl
- Address of a string variable that contains the base URL.
- lpszRelativeUrl
- Address of a string variable that contains the relative URL.
- lpszBuffer
- Address of a buffer that receives the resulting URL.
- lpdwBufferLength
- Address of an unsigned long integer value that contains the size, in bytes, of the lpszBuffer buffer. If the function succeeds, this parameter receives the length, in characters, of the resultant combined URL—the length does not include the null terminator. If the function fails, this parameter receives the length, in bytes, of the required buffer—the length includes the null terminator.
- dwFlags
- Unsigned long integer value that contains the flags controlling the operation of the function. This can be one of the following values:
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_SPACES_ONLY Encodes spaces only. 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 versions of the Win32® Internet functions. 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:
ERROR_BAD_PATHNAME The URLs could not be combined. ERROR_INSUFFICIENT_BUFFER The buffer supplied to the function was insufficient or NULL. The DWORD indicated by the lpdwBufferLength parameter will contain the number of bytes required to hold the resultant, combined URL. ERROR_INTERNET_INVALID_URL The format of the URL is invalid. ERROR_INVALID_PARAMETER There is a bad string, buffer, buffer size, or flags parameter.
Function Information
Windows NT Use version 4.0 and later. Implemented as ANSI and Unicode functions. Windows Use Windows 95 and later. Implemented as ANSI and Unicode functions. Header Wininet.h Import library Wininet.lib Minimum availability Internet Explorer 3.0 (ANSI only), 5 (ANSI and Unicode)
See Also
Microsoft Win32 Internet Functions Overview, Handling Uniform Resource Locators, Microsoft Win32 Internet Functions Reference, Uniform Resource Locator (URL) Functions
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.