Article ID: 263909 - View products that this article applies to.
This article was previously published under Q263909
When you use the ShellExecute or ShellExecuteEx function on version 4.0 of the Shell32.dll file to open a URL, the URL is limited to (MAX_PATH - 1) characters. A URL should be able to be as long as (INTERNET_MAX_URL_LENGTH - 1) (defined in Wininet.h) characters.
ShellExecute and ShellExecuteEx copy the file string into an internal buffer. In the original version of Shell32.dll, the buffer's maximum size is MAX_PATH characters. Starting with Shell32.dll version 4.71, this internal buffer is expanded to INTERNET_MAX_URL_LENGTH characters.
This problem can be overcome by creating a temporary Internet shortcut file that contains the long URL and passing the Internet shortcut file to ShellExecute or ShellExecuteEx. After calling ShellExecute or ShellExecuteEx, this file can safely be deleted.
Code such as the following can be used to create an Internet shortcut file:
This behavior has been corrected in version 4.71 and later of Shell32.dll.
Article ID: 263909 - Last Review: July 11, 2005 - Revision: 1.2
Contact us for more help
Connect with Answer Desk for expert help.