Results 1 to 5 of 5

Thread: icError

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    USA
    Posts
    16

    Angry

    I have a program that uses the Inet control. My problem is once it encounters an error (icError in StateChanged event to be specific) my program will freeze. I've tried to issue an Inet.Cancel statement but to no avail. HELP!!!


    Here's a portion of my code....

    Private Sub Inet1_StateChanged(ByVal State As Integer)
    On Error GoTo Errors
    Select Case State
    Case icNone
    Me.Caption = ""
    .
    .
    .
    Case icError
    Inet1.Cancel
    Case icResponseCompleted
    Me.Caption = "Completed..."
    End Select

    End Sub

    [Edited by jsayson on 07-19-2000 at 01:06 PM]

  2. #2
    Lively Member
    Join Date
    Jan 1999
    Location
    Karjalohja, Finland
    Posts
    123
    Cancel method not working great. But if you want using Cancel try this.

    Do While Inet1.StillExecuting
    Inet1.Cancel
    DoEvents
    Loop

    -Dj4

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    USA
    Posts
    16
    O yah, that's a great idea. But what I want is for my program to exit gracefully in case it encounters the icError state.

  4. #4
    Lively Member
    Join Date
    Jan 1999
    Location
    Karjalohja, Finland
    Posts
    123
    I don't know how that works but try:

    Select Case State
    ...
    Case icError
    Inet1.Execute , "QUIT"
    Do
    DoEvents
    Loop While Inet1.StillExecuting

    OR

    Inet1.Execute , "CLOSE"
    Do
    DoEvents
    Loop While Inet1.StillExecuting

    End Select

    -Dj4

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    USA
    Posts
    16
    I think the example you've shown to me works only on FTP. Here's my inet statement.


    public function xxxx()
    do until ....
    inet1.cancel
    Buffer = Inet1.OpenURL(txtURL.Text, icString)

    ......process the contents of buffer here
    loop
    end function


    what my appl will do is to retrieve the HTML code of the given URL only not download it. usually my appl will be able to loop and retrieve a few thousands of data before it encounters the icError. And once it encounters the error it immediately hung's up. I suspect that error is related to timeout request, but what I want is for my program to exit gracefully instead of being locked-up.

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