Knowledge Base

BUG: OpenURL Method Bug in Internet Transfer Control

Article ID: 186842

Article Last Modified on 12/11/2003


APPLIES TO


This article was previously published under Q186842

SYMPTOMS

When you use the OpenURL method on the Internet Transfer Control for FTP URLs, it causes the application to hang. Upon exiting the application, the application hangs and causes 100% CPU utilization. When you use code similar to the following:
   Private Sub butGet_Click()

      Dim sData as String

      Inet.AccessType = icDirect
      sData = Inet.OpenURL ("ftp://ftp.somedomain.com/SomeFile.txt")
   End Sub
				

And, you use the Internet Transfer Control, the application hangs and further ITC requests fail. Upon exiting the application, the GUI portion of the application closes, however the Task Manager (under Windows NT) displays the application as running and utilizing 100% of the CPU. You can terminate the application only through the Task Manager.

RESOLUTION

The workaround to this bug is to either use the Execute method or use the WinInet APIs directly. For example, the Execute method could be:
   Private Sub butGet_Click()

      Inet.AccessType = icDirect
      Inet.URL = "ftp://ftp.somedomain.com/SomeFile.txt"
      Inet.Execute "", "GET"

   End Sub

   Private Sub Inet_StateChanged(ByVal State As Integer)
      Dim sData As String

      If State = 12 Then
         sData = Inet.GetChunk(4096) 'SomeFile.txt < 4KB in size.
      End If

   End Sub
				

For an example of the WinInet API, please see the VBFTP sample referred to in the following article in the Microsoft Knowledge Base:

175179 : FILE: VBFTP.EXE: Implementing FTP Using WinInet API from VB

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

Use the following code in any Visual Basic 5.0 project that uses the Internet Transfer Control:
   Private Sub butGet_Click()

      Dim sData as String

      Inet.AccessType = icDirect
      sData = Inet.OpenURL ("ftp://ftp.somedomain.com/SomeFile.txt")

   End Sub
				

Additional query words: kbVBp600bug kbVBp500bug kbDSupport kbdsi kbInternet kbFTP kbhttp

Keywords: kbbug KB186842