Microsoft KB Archive/174897: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 56: Line 56:


The following code fragment:
The following code fragment:
<pre class="codesample">hURL = InternetOpenUrl( hSession, &quot;http://server/document.htm&quot;, NULL, 0,
<pre class="codesample">hURL = InternetOpenUrl( hSession, "http://server/document.htm", NULL, 0,
     NULL, 1 );
     NULL, 1 );
                 </pre>
                 </pre>
could be changed to the following:
could be changed to the following:
<pre class="codesample">  hConnect = InternetConnect(hSession, &quot;server&quot;,
<pre class="codesample">  hConnect = InternetConnect(hSession, "server",
     INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP,
     INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP,
     NULL, NULL);
     NULL, NULL);
   hRequest = HttpOpenRequest(hConnect, NULL, &quot;/document.htm&quot;, NULL, NULL,
   hRequest = HttpOpenRequest(hConnect, NULL, "/document.htm", NULL, NULL,
     NULL, NULL, NULL);
     NULL, NULL, NULL);
   HttpSendRequest(hRequest, NULL, NULL, NULL, NULL);
   HttpSendRequest(hRequest, NULL, NULL, NULL, NULL);

Latest revision as of 11:07, 21 July 2020

Knowledge Base


FIX: Memory Leak in InternetOpenUrl Function in ActiveX SDK

Article ID: 174897

Article Last Modified on 5/17/2002



APPLIES TO

  • Microsoft Internet Explorer 3.0
  • Microsoft Windows Internet Services (WinInet)



This article was previously published under Q174897

SYMPTOMS

A memory leak occurs when the InternetOpenUrl function is used.

RESOLUTION

If the URL in use is for the HTTP protocol, InternetConnect, HttpOpenRequest, and HttpSendRequest can be substituted for InternetOpenUrl, avoiding the problem.

EXAMPLE

The following code fragment:

hURL = InternetOpenUrl( hSession, "http://server/document.htm", NULL, 0,
    NULL, 1 );
                

could be changed to the following:

   hConnect = InternetConnect(hSession, "server",
    INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP,
    NULL, NULL);
   hRequest = HttpOpenRequest(hConnect, NULL, "/document.htm", NULL, NULL,
    NULL, NULL, NULL);
   HttpSendRequest(hRequest, NULL, NULL, NULL, NULL);
                

STATUS

This bug has been fixed in Internet Explorer 4.0 and the Internet Client SDK.

Keywords: kbbug kbfix KB174897