Solved

URLDownloadToFile Function in URLMON.DLL

Posted on 2002-07-03
9
1,195 Views
Last Modified: 2012-05-04
If you call URLDownloadToFile and it takes more than an hour to download a file, the function returns with an error code. Is there a way to set the timeout through the DLL (if needed) to allow for a longer timeout?
0
Comment
Question by:joekendall
9 Comments
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 200 total points
ID: 7127999
I think it doesn't depends upon dll function. Check your internet options to se if there is an automatic disconnection after pass a hour. If so, function will returns error if download was not completed.
0
 
LVL 11

Author Comment

by:joekendall
ID: 7128071
I'm having the guy check it out. I agree, but I thought I would ask to make sure.

Thanks!

Joe
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7128088
Hi joekendall,

there is a setting to implement, tho i only found some c++ code it's called the onProgress property and from there you should be able to get the progress and eventually the timeout settings

in the wininet control there is a setting for timeouts but it was buggy

HAGD:O)Bruintje
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7128108
The Onprogress depends upon a callback function, if some one has the definition for it...
0
 
LVL 11

Author Comment

by:joekendall
ID: 7128133
Yes, I have looked at the OnProgress callback. I have seen some C++ code myself.

Here is some information on the OnProgress. Anyone have any ideas on how to extract a TimeOut from the OnProgress?

Indicates the progress of the bind operation.

Syntax

HRESULT OnProgress(          ULONG ulProgress,
    ULONG ulProgressMax,
    ULONG ulStatusCode,
    LPCWSTR szStatusText
);
Parameters

ulProgress
[in] Unsigned long integer that contains the current progress of the bind operation relative to the expected maximum indicated in the ulProgressMax parameter.
ulProgressMax
[in] Unsigned long integer that contains the expected maximum value of the ulProgress parameter for the duration of calls to IBindStatusCallback::OnProgress for this bind operation. Note that this value might change across calls to this method. A value of zero means that the maximum value of ulProgress is unknown (for example, in the IMoniker::BindToStorage method when the data download size is unknown).
ulStatusCode
[in] Unsigned long integer that receives additional information regarding the progress of the bind operation. This can be any of the BINDSTATUS values.
szStatusText
[in] Address of a string value that contains the textual information indicating the current progress of the bind operation. The text reflects the BINDSTATUS value of the ulStatusCode parameter and is appropriate for display in the user interface of the client.
Return Value

Returns S_OK if successful, or E_INVALIDARG if one or more parameters are invalid.

Remarks

The moniker calls this method repeatedly to indicate the current progress of the bind operation, typically at reasonable intervals during a lengthy operation.

The client can use the progress notification to provide progress information to the user from the ulProgress, ulProgressMax, and szStatusText parameters, or to make programmatic decisions based on the ulStatusCode parameter.

Client applications that implement the IBindStatusCallback interface can return E_UNIMPL or S_OK if they don't need to receive this notification.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 7128142
IBindStatusCallback interface is not directly accessible from VB.  It must be altered into a compatible type library.  Eduardo has done this and included the interface in his large OLELib type library w/ sample class showing its use:

http://www.domaindlx.com/e_morcillo/scripts/tips/en/general/adl.asp
0
 
LVL 11

Author Comment

by:joekendall
ID: 7140454
If they up the timeout on the web server, the reports will run. That is not what they did though. They store some information in a DB and poll to see if it is done.

Thanks!

Joe
0
 
LVL 11

Author Comment

by:joekendall
ID: 7140461
AzraSound:

Please pick up points at http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=visualbasic&qid=20321205 for the additional information you supplied. It was much appreciated.

Thanks!

Joe
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7142033
Thanks for "A" grade.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
VB 6.0 printer how to align 6 67
JSON Response and request in VB6 application 11 574
Updates not working for MS Windows 7 12 181
How to debug this code 7 64
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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

840 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