Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

URLDownloadToFile Function in URLMON.DLL

Posted on 2002-07-03
9
Medium Priority
?
1,264 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
[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
9 Comments
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 800 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
Industry Leaders: 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!

 
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…
Suggested Courses

636 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