Article ID: 839873
On a computer that is running Microsoft Internet Explorer 6.0 with the security update MS04-004, when you try to call the InternetConnect method and then the SendRequest API of the WinINet library by passing the server name or the IP address followed by the virtual directory name, you may receive the following error message:
Note This error message corresponds to the following error message:
SendRequest error 12007
This error message translates to the following:
The server name could not be resolved
If you try to pass a server name with the virtually directory name to the InternetConnect method, you will notice the error message that is mentioned in the "Symptoms" section. The newer build of the WinINet library adheres strictly to the way that the Microsoft Developer Network (MSDN) documents the use of this API. WinINet does not support passing this kind of parameter to the InternetConnect method.
The MSDN documentation for the InternetConnect method describes the second parameter of the InternetConnect method as the following:
lpszServerNameTherefore, the InternetConnect method does not accept anything else other than the server name. If you also pass the virtual directory after the server name, your call to the InternetConnect method fails.
[in] Pointer to a null-terminated string that specifies the host name of an Internet server. Alternately, the string can contain the IP number of the site, in ASCII dotted-decimal format (for example, 188.8.131.52).
To resolve this problem, do not pass anything other than the server name in the InternetConnect method. However, you can pass the IP address instead of the server name. For example, set the value of the lpszServerName parameter to 184.108.40.206. Therefore, the InternetConnect method only accepts the server name or the IP address. Alternatively, you can supply the path of the virtual directory followed by the file that you want to render in the HttpOpenRequest API after you call the InternetConnect method. For example, /mydir/myfile.html.
To resolve this problem, you can pass the IP or the server name in the InternetConnect method. For example, you can use the InteretConnect method as follows:
Steps to reproduce the behavior
Upgrade Microsoft Internet Explorer 6.0
Create a project
Add code to the project
Build and then debug the project
For additional information, visit the following Microsoft Web sites:
Microsoft Security Bulletin MS04-004
Article ID: 839873 - Last Review: June 20, 2014 - Revision: 2.0
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.