Solved

simultaneous downloading

Posted on 1998-07-07
2
150 Views
Last Modified: 2010-05-03
I'm trying to retrieve 2 files off the web at 1 time using the "execute" method in the Internet Transfer Control, but everytime it says it's..."still executing last request..".  I want it to happen right when I open a form automatically, but can't seem to figure out how to make it wait for the 1st
file request (URL) and then proceed to the next URL.  These 2 pictures are separate on the form.

Here's what I've got:
----------------------------------------------------------

Private Sub Form_Load()
    Dim strURL1 as String
    Dim strURL2 as String
    strURL1 = "http://............/pic1.gif"
    strURL2 = "http://............/pic2.gif"
    Inet1.Execute strURL1, "GET"
    Inet1.Execute strURL2, "GET"
End Sub
----------------------------------------------------------

Private Sub Inet1_StateChanged(ByVal State As Integer)
    Dim image() as byte
    Dim intfile as integer

    intfile = Freefile()

    Case 12:
        image() = Inet1.GetChunk(25000, icByteArray)
        Open "C:\temp\pic1.gif" For Binary Access Write As #intfile
        Put #intfile, , image()
        Close #intfile
        Image1.Picture = LoadPicture("c:\temp\pic1.gif")

        image() = Inet1.GetChunk(25000, icByteArray)
        Open "C:\temp\pic2.gif" For Binary Access Write As #intfile
        Put #intfile, , image()
        Close #intfile
        Image2.Picture = LoadPicture("c:\temp\pic2.gif")

End Sub
----------------------------------------------------------

Of course...the above doesn't work...  :)

Appreciate any help!
Thanks,
Fred
0
Comment
Question by:woodie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
Jagar earned 50 total points
ID: 1465158
change the above code to execute the first command then wait in the StateChanged Event for the Complete command (look in the help for exact constant).  Then Execute the second command.
If the two must happen at the same time then you have to use two INET controls and execute one on the first control and the other on the second control.
0
 
LVL 1

Expert Comment

by:thomas_mathiesen
ID: 4304850
Sir, you cannot use "GET" method if it is a website. You must use the openurl and save the file as binary (see msdn for example).

=)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Determine Range to Select 5 56
Advice in Xamarin 21 109
Set email body to html using vbscript 6 71
add criteria to query in VB, Access 2003 2 30
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question