Solved

URLDownloadToFile Function in URLMON.DLL

Posted on 2002-07-03
9
1,165 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
The Onprogress depends upon a callback function, if some one has the definition for it...
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 11

Author Comment

by:joekendall
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for "A" grade.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now