Solved

simultaneous downloading

Posted on 1998-07-07
2
151 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…

739 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