Click to return to the Networking, Protocols     
InternetCanonicalizeUrl F...     InternetCrackUrl Function     Uniform Resource Locator ...    
Web Workshop  |  Networking, Protocols & Data Formats

InternetCombineUrl Function


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. For more information, see Win32 Internet Functions Syntax.

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 combined URL.
lpdwBufferLength
Address of an unsigned long integer value that contains the size, in TCHARs, of the lpszBuffer buffer. If the function succeeds, this parameter receives the length, in TCHARs, of the combined URL—this length does not include the null terminator. If the function fails, this parameter receives the length, in bytes, of the required buffer—this 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_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_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:

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 a bad string, buffer, buffer size, or flags parameter.

Function Information

Windows NT Use version 4.0. 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)

Windows CE

Windows CE Use version 2.12 and later. Implemented as ANSI and Unicode functions.
Minimum availability Internet Explorer 4.0

See Also

Microsoft Win32 Internet Functions Overview, Handling Uniform Resource Locators, Microsoft Win32 Internet Functions Reference, Uniform Resource Locator (URL) Functions



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.