Link to home
Start Free TrialLog in
Avatar of joekendall
joekendallFlag for United States of America

asked on

URLDownloadToFile Function in URLMON.DLL

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?
ASKER CERTIFIED SOLUTION
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of joekendall

ASKER

I'm having the guy check it out. I agree, but I thought I would ask to make sure.

Thanks!

Joe
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
The Onprogress depends upon a callback function, if some one has the definition for it...
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.
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
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
AzraSound:

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

Thanks!

Joe
Thanks for "A" grade.