MIMEAssociationDialog Fun...     URLAssociationDialog Func...     Internet Shortcut Global ...    
Web Workshop (Miscellaneous)

TranslateURL Function


Applies common translations to a given URL string, creating a new URL string.

Syntax

HRESULT WINAPI TranslateURL(
    LPCSTR pcszURL,
    DWORD dwInFlags,
    LPSTR *ppszTranslatedURL
);

Parameters

pcszURL
Address of the URL string to be translated.
dwInFlags
Bit flags that specify how the URL string is to be translated. This value can be one or more of the following:
TRANSLATEURL_FL_GUESS_PROTOCOL
If the protocol scheme is not specified in the pcszURL parameter of TranslateURL, the system automatically chooses a scheme and adds it to the URL.
TRANSLATEURL_FL_USE_DEFAULT_PROTOCOL
If the protocol scheme is not specified in the pcszURL parameter of TranslateURL, the system adds the default protocol to the URL.
ppszTranslatedURL
Address of the pointer to the newly created, translated URL string, if any. The ppszTranslatedURL parameter is valid only if the function returns S_OK.

Return Value

Returns one of the following values:

S_OKThe URL was translated successfully.
S_FALSE The URL did not require translation.
E_FLAGS The flag combination passed in dwInFlags is invalid.
E_OUTOFMEMORY There was insufficient memory to complete the operation.
E_POINTER One of the input pointers is invalid.

Remarks

TranslateURL changes the protocol of the URL based on the flags set in dwInFlags. This function does not validate the input URL string. A successful return value does not indicate that the URL strings are valid URLs.

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 Intshcut.h
Minimum availability Internet Explorer 4.0


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.