Results 1 to 5 of 5

Thread: Question about the 'INTERNET_STATUS_CALLBACK'

  1. #1
    Guest

    Post

    I'm useing the InternetSetStatusCallback
    Declare Function InternetSetStatusCallback Lib "wininet.dll" (ByVal byvalHINTERNET As Long, ByVal INTERNET_STATUS_CALLBACK As Any) As Long
    To get a statechanged like even from the wininet.dll

    I am able to resolve the 'lpvStatusInformation' so that i can get the basic statechanged like events, but im wondering if i can get more information out of it.

    (I also use it because without it the FtpGetFile hangs until it's finished and thats darn ugly .

    Here's is my callback sub
    Code:
    Sub INTERNET_STATUS_CALLBACK(ByVal HINTERNET As Long, ByVal dwContext As Long, ByVal dwInternetStatus As Long, ByVal lpvStatusInformation As Long, ByVal dwStatusInformationLength As Long)
        Dim sTemp  As String
        DoEvents
        Select Case dwInternetStatus
            Case INTERNET_STATUS_RESOLVING_NAME
                sTemp = "INTERNET_STATUS_RESOLVING_NAME"
            Case INTERNET_STATUS_NAME_RESOLVED
                sTemp = "INTERNET_STATUS_NAME_RESOLVED"
            Case INTERNET_STATUS_CONNECTING_TO_SERVER
                sTemp = "INTERNET_STATUS_CONNECTING_TO_SERVER"
            Case INTERNET_STATUS_CONNECTED_TO_SERVER
                sTemp = "INTERNET_STATUS_CONNECTED_TO_SERVER"
            Case INTERNET_STATUS_SENDING_REQUEST
                sTemp = "INTERNET_STATUS_SENDING_REQUEST"
            Case INTERNET_STATUS_REQUEST_SENT
                sTemp = "INTERNET_STATUS_REQUEST_SENT"
            Case INTERNET_STATUS_RECEIVING_RESPONSE
                sTemp = "INTERNET_STATUS_RECEIVING_RESPONSE"
            Case INTERNET_STATUS_RESPONSE_RECEIVED
                sTemp = "INTERNET_STATUS_RESPONSE_RECEIVED"
            Case INTERNET_STATUS_CTL_RESPONSE_RECEIVED
                sTemp = "INTERNET_STATUS_CTL_RESPONSE_RECEIVED"
            Case INTERNET_STATUS_PREFETCH
                sTemp = "INTERNET_STATUS_PREFETCH"
            Case INTERNET_STATUS_CLOSING_CONNECTION
                sTemp = "INTERNET_STATUS_CLOSING_CONNECTION"
            Case INTERNET_STATUS_CONNECTION_CLOSED
                sTemp = "INTERNET_STATUS_CONNECTION_CLOSED"
            Case INTERNET_STATUS_HANDLE_CREATED
                sTemp = "INTERNET_STATUS_HANDLE_CREATED"
            Case INTERNET_STATUS_HANDLE_CLOSING
                sTemp = "INTERNET_STATUS_HANDLE_CLOSING"
            Case INTERNET_STATUS_REQUEST_COMPLETE
                sTemp = "INTERNET_STATUS_REQUEST_COMPLETE"
            Case INTERNET_STATUS_REDIRECT
                sTemp = "INTERNET_STATUS_REDIRECT"
            Case INTERNET_STATUS_INTERMEDIATE_RESPONSE
                sTemp = "INTERNET_STATUS_INTERMEDIATE_RESPONSE"
            Case INTERNET_STATUS_STATE_CHANGE
                sTemp = "INTERNET_STATUS_STATE_CHANGE"
        End Select
    
        Debug.Print sTemp, HINTERNET, dwContext, dwInternetStatus, lpvStatusInformation, dwStatusInformationLength
    End Sub
    PS. I think it's right but i ain't sure, i converted the info from the wininet.h




    ------------------

    Vincent van den Braken
    EMail: azzmodan@azzmodan.demon.nl
    ICQ: 15440110
    Homepage: http://www.azzmodan.demon.nl




  2. #2

    Post

    To see example of the use of wininet callback function you can download FTP client sample app from www.vbip.com. But note that you can use wininet callback function only with VB5.

    ------------------
    Oleg Gdalevich, MCSD

    Visual Basic Internet Programming website

  3. #3
    Guest

    Post

    Excactly what i meant, thanks a lot.

    (Now I only had to reinvent half of the wheel )

    Converting it from the winint.h was fun, but copy/past is easy'r to do.

    ------------------

    Vincent van den Braken
    EMail: azzmodan@azzmodan.demon.nl
    ICQ: 15440110
    Homepage: http://www.azzmodan.demon.nl





    [This message has been edited by Azzmodan (edited 02-07-2000).]

  4. #4
    Member
    Join Date
    Apr 2009
    Posts
    48

    Re: Question about the 'INTERNET_STATUS_CALLBACK'

    I don't suppose you kept the finished code for this?

  5. #5
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: Question about the 'INTERNET_STATUS_CALLBACK'

    Quote Originally Posted by neotechni View Post
    I don't suppose you kept the finished code for this?
    Did you notice that this thread is over 22 years old?

    In any case, it seems that the relevant code you may be looking for was included in the referenced FTP client sample app. Below is a link to the Wayback Machine where you download that sample app.

    https://web.archive.org/web/20000817...ftp_client.zip

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