Results 1 to 5 of 5

Thread: Doing stuff while URLDownloadToFile is active

  1. #1

    Thread Starter
    Fanatic Member Kzin's Avatar
    Join Date
    Dec 2000
    Posts
    611

    Question Doing stuff while URLDownloadToFile is active

    I'm sure that this is a dumb question but

    URLDownloadToFile seems to take over my app when active and I want my user to be able to enter stuff in Textboxes etc while the download is occuring. How do I do this?
    Looking for a friendly intelligent chat forum? Visit the white-hart.net

  2. #2
    Frenzied Member jjortiz's Avatar
    Join Date
    Mar 2001
    Location
    NYC
    Posts
    1,768
    I think you would use the DoEvents keyword. I am not too sure on that.

  3. #3
    Fanatic Member
    Join Date
    May 2001
    Posts
    837
    DoEvents won't work unless you're in a loop, the first thing that comes to mind is make another application that has only a SubMain routine, and pass in the download arguements as commandline parameters. I've never done anything like that before but its what my little brain thought of first, anyone else have an easier solution?

  4. #4

    Thread Starter
    Fanatic Member Kzin's Avatar
    Join Date
    Dec 2000
    Posts
    611
    Originally posted by jjortiz
    I think you would use the DoEvents keyword. I am not too sure on that.
    I think DoEvents would allow other things to happen at the time of calling but could not be triggered in the middle of a ten minute download - is that right?

    Code:
    Public Function DownloadFile(URL As String, _
        LocalFilename As String) As Boolean
        Rem call the DownloadFile function, passing it your URL and local filename. The function will then use the API to download the file and return a True if successful.
        Dim lngRetVal As Long
        'Screen.MousePointer = 11
        GlobalFlag_Downloaded = False
        lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
        Screen.MousePointer = 0
        If lngRetVal = 0 Then DownloadFile = True
        GlobalFlag_Downloaded = True
    
    End Function
    Looking for a friendly intelligent chat forum? Visit the white-hart.net

  5. #5

    Thread Starter
    Fanatic Member Kzin's Avatar
    Join Date
    Dec 2000
    Posts
    611
    OK if you ever find that you want to do this yourself the MSDN URL is this with the IBindStatusCallback interface.

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