Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

simultaneous downloading

Posted on 1998-07-07
2
Medium Priority
?
153 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 100 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

Technology Partners: 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

719 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