Results 1 to 3 of 3

Thread: [RESOLVED] Inet Control Stopped Working

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2017

    Resolved [RESOLVED] Inet Control Stopped Working

    I wrote a program in VB6 years ago that would load the contents of a web page, and send me a text message if there were any changes to the page. It has been running flawlessly on an old XP laptop for over 10 years, until recently. I am using the Inet control, like this:

    Inet.AccessType = icDirect
    rtxtSource.Text = Inet.OpenURL(Url)

    I don't know what has changed, but all of a sudden Inet is not returning a string, the contents are nul.

    So, I tried running the program on my Windows 7 machine to see what would happen, and the program works, but with one big difference. On my XP machine, when it was working and I saved the contents to a file, the file size was always 64k:

    temppage.txt 7/18/2009 Text Document 64KB

    Now it is:

    temppage.txt 10/6/2017 Text Document 0KB

    But, on the Windows 7 machine it is always:

    temppage.txt 10/6/2017 Text Document 14KB

    Before, the 64KB file on the XP machine represented a slightly truncated web page, but it contained all the information I needed. On the Windows 7 machine, the program is only returning 14KB of data, which is not enough information. Can anyone help with this please, and tell me: a)why did Inet suddenly stop working on my XP machine?, and b)why do I only get 14KB of data on my Windows 7 machine?

    Ideally I would like to be able to get this working on Windows 7 so that I can retire the old XP laptop, but if not and I can get it working again on XP, that would be great too. I should add that I also transferred the program to another old XP machine, and I get the same results on that one.

    I am a novice programmer, and only ever learned enough to be dangerous. Thanks in advance for any help.

  2. #2
    Join Date
    Feb 2006

    Re: Inet Control Stopped Working

    That control has been obsolete for a very long time. About the only thing I might consider using for it FTP, since we don't have another readily available FTP control. Even then I'd probably look for a 3rd party alternative for FTP because it is so clunky to work with and lacks support for newer FTP features.

    One problem people have reported recently is that the control no longer works for HTTPS to many sites unless IE 11 is installed. That is probably because of changes to the SLL/TLS cipher suites in use as people move web servers away from supporting older ciphers that were too easy to exploit.

    If installing IE11 doesn't work I'm not sure what your problem might be. That isn't even an option on the dead Windows XP anyway as far as I know.

    Your best option is probably to rewrite using WinHttp 5.1, which has been part of Windows for a very long time now. Simple demo:

    Option Explicit
    'Reference to: Microsoft WinHTTP Services, version 5.1
    'Requires Windows Vista, Windows XP SP1, or Windows 2000
    'Professional SP3 and later.
    Private Sub Main()
        Dim HTTPRequest As WinHttp.WinHttpRequest
        Set HTTPRequest = New WinHttp.WinHttpRequest
        With HTTPRequest
            .Open "GET", "http://tycho.usno.navy.mil/cgi-bin/timer.pl", True
            If .WaitForResponse(3) Then
                MsgBox .ResponseText
                MsgBox "Timed out after 3 seconds."
            End If
        End With
        Set HTTPRequest = Nothing
    End Sub
    See: WinHttpRequest object

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2017

    Re: Inet Control Stopped Working

    I can't thank you enough, this solution worked perfectly on my Windows 7 machine. Here is the new file size:

    temppage.txt 10/6/2017 Text Document 639KB

    I'll test it on XP later, and if I can't get it to work there then I'll use it as an excuse to upgrade to a Windows 7 laptop to run this program, which I leave running 24/7.

    Thank you so much again for your expert help.

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