UrlCreateFromPathA function (shlwapi.h)
Converts a Microsoft MS-DOS path to a canonicalized URL.
Syntax
LWSTDAPI UrlCreateFromPathA(
[in] PCSTR pszPath,
[out] PSTR pszUrl,
[in, out] DWORD *pcchUrl,
DWORD dwFlags
);
Parameters
[in] pszPath
Type: PCTSTR
A null-terminated string of maximum length INTERNET_MAX_URL_LENGTH that contains the MS-DOS path.
[out] pszUrl
Type: PTSTR
A pointer to a buffer that, when this function returns successfully, receives the URL.
[in, out] pcchUrl
Type: DWORD*
The number of characters in pszUrl.
dwFlags
Type: DWORD
Reserved. Set this parameter to NULL.
Return value
Type: HRESULT
Returns S_FALSE if pszPath is already in URL format. In this case, pszPath will simply be copied to pszUrl. Otherwise, it returns S_OK if successful or a standard COM error value if not.
Remarks
Note
The shlwapi.h header defines UrlCreateFromPath as an alias that 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 is 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, Windows XP [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | shlwapi.h |
Library | Shlwapi.lib |
DLL | Shlwapi.dll (version 5.0 or later) |