Results 1 to 3 of 3

Thread: Continued problems on internet transfers

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 1999
    Location
    Atlanta, GA
    Posts
    75

    Post

    I recently ran into a problem where my program would hang on final unloading due to an evident problem with the Microsoft Internet Control. I substituted Wininet API's instead, but I am still running into the problem. Am I forgetting to do something at the end of my program? Below is the code for the function I use everytime I pull a web page in the program:

    Private Function rf_web(ls_webAddress As String) As String
    Dim ll_open As Long
    Dim ll_openURL As Long
    Dim ls_return As String
    Dim ls_tempBuffer As String * 2048
    Dim ll_bytes As Long

    ll_open = InternetOpen("vb wininet", INTERNET_OPEN_TYPE_DIRECT, vbNullString, vbNullString, 0)
    ll_openURL = InternetOpenUrl(ll_open, ls_webAddress, vbNullString, 0, INTERNET_FLAG_RELOAD, 0)
    ls_return = ""

    Do While Len("hold") > 0
    ls_tempBuffer = ""
    InternetReadFile ll_openURL, ls_tempBuffer, Len(ls_tempBuffer), ll_bytes
    ls_return = ls_return & Left$(ls_tempBuffer, ll_bytes)

    If Not CBool(ll_bytes) Then Exit Do
    Loop

    InternetCloseHandle ll_openURL
    InternetCloseHandle ll_open
    rf_web = ls_return
    End Function

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    Can you post the APIs that you are using?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 1999
    Location
    Atlanta, GA
    Posts
    75

    Post

    The API's I am using in the program are the following:

    Public Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType _
    As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
    Public Declare Function InternetOpenUrl Lib "wininet.dll" Alias "InternetOpenUrlA" (ByVal hOpen As Long, ByVal sUrl As _
    String, ByVal sHeaders As String, ByVal lLength As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
    Public Declare Function InternetReadFile Lib "wininet.dll" (ByVal hFile As Long, ByVal sBuffer As String, ByVal _
    lNumBytesToRead As Long, lNumberOfBytesRead As Long) As Integer
    Public Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer

    Public Const INTERNET_OPEN_TYPE_DIRECT = 1
    Public Const INTERNET_FLAG_RELOAD = &H80000000

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width