Solved

URLDownloadToFile & progressbar

Posted on 2003-11-19
9
2,872 Views
Last Modified: 2012-06-22
Hi

Anyone know how to implement a progressbar with the URLDownloadToFile call??

Thanks.
0
Comment
Question by:rynoster
[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 6

Expert Comment

by:pritaeas
ID: 9777957
Hi. That function does not support it. Have a look at the other functions in the WinINet API: InternetRead especially. You can use it to read in a block of data, thus enabling a way to control a progressbar since you know how much is coming in at a time. With InternetQuery(... something) you can ask the filesize. Don't have the code with me here, but if you send me an e-mail I'll try to find it in my backups and sent it to you.

hth, pritaeas
pritaeas@hotmail.com
0
 

Author Comment

by:rynoster
ID: 9778009
One of the parameters in the URLDownloadToFile function is, IBindStatusCallBack, which, according to MS is a way to control a progress bar. I just don't know how!!

I'll send you an email anyway.

Thanks.
0
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9778230
A client requesting an asynchronous bind operation must provide a notification object exposing the IBindStatusCallback interface. The asynchronous moniker provides information on the bind operation to the client by calling notification methods on the client's IBindStatusCallback interface. This interface also allows the client to pass additional bind information to the moniker by calling the IBindStatusCallback::GetBindInfo and IBindStatusCallback::GetPriority methods after receiving a call from IMoniker::BindToObject or IMoniker::BindToStorage .

IBindStatusCallback Members

GetBindInfo Provides information about how the bind operation should be handled when called by an asynchronous moniker.
GetPriority Obtains the priority for the bind operation when called by an asynchronous moniker.
OnDataAvailable Provides data to the client as it becomes available during asynchronous bind operations.
OnLowResource Not currently implemented.
OnObjectAvailable Passes the requested object interface pointer to the client.
OnProgress Indicates the progress of the bind operation.
OnStartBinding Notifies the client about the callback methods it is registered to receive. This notification is a response to the flags the client requested in the RegisterBindStatusCallback function.
OnStopBinding Indicates the end of the bind operation.

//////////////////////////////////////////////
IBindStatusCallback::OnProgress Method

--------------------------------------------------------------------------------

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.
0
Independent Software Vendors: 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!

 

Author Comment

by:rynoster
ID: 9778559
Hi

Thanks for the reply.
This is all very useful info, but I still don't know how to implement with the URLDownloadToFile function...

Thanks.
0
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9778854
You need to write a component(object) with IBindStatusCallBack interface.
And give the interface to URLDownloadToFile.
If I'm not mistaken you'll get notifications to the component(object).
0
 

Author Comment

by:rynoster
ID: 9778976
Any ideas on how to do this??
0
 
LVL 17

Accepted Solution

by:
geobul earned 100 total points
ID: 9779891
0
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9787447
rynoster, didn't I help you? You think that I've not earned some points?
0
 

Author Comment

by:rynoster
ID: 9788240
Hey Gloomyfair.

Thanx for all ur comments, and, not 2 b rude or anything, but it didn't help me much.

But don't worry, there's always a next time.

Sorry.
Thanx to Geo for helping me!!
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

717 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