|
-
Mar 7th, 2001, 11:55 PM
#1
Thread Starter
PowerPoster
I use this API to download files:
Code:
Public Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
The problem is I want to use a progress bar and I have no idea how to make that Any help appreciated!
-
Mar 8th, 2001, 10:25 AM
#2
Thread Starter
PowerPoster
-
Mar 8th, 2001, 12:41 PM
#3
PowerPoster
Fox, I did ask for this before and yet no reply so far
-
Mar 8th, 2001, 02:22 PM
#4
I emailed a anti-virus program company called Protector Plus and asked them how to do it, because they use the urlmon.dll and it shows the progress, how much is complete, how much time is remaining, etc.
They emailed back, and didn't seem to know how to do it .
To me, they were playing dumb, but they probably just didn't want to tell me .
-
Mar 8th, 2001, 03:33 PM
#5
Thread Starter
PowerPoster
so I'll try to figure it out..
I'll post here when done
-
Mar 8th, 2001, 08:03 PM
#6
Fanatic Member
it's done using a callback interface (Says MSDN). I don't think it's possible in VB, becuase i don't think you can create a Callback Interface. Maybe it's possible, but i don't think so
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Mar 9th, 2001, 01:24 AM
#7
Thread Starter
PowerPoster
If it's impossible that would explain why I didnt' know how to do it in VB (since I know how to do it in C) but I think there must be a way
-
Mar 9th, 2001, 01:22 PM
#8
Hyperactive Member
fox, how are you using the call?
i.e. what are you using as parameter 1?
buzzwords are the language of fools
-
Mar 10th, 2001, 04:38 PM
#9
Good Ol' Platypus
Try using hooks and seeing if you can get any extra info that way (eg. bytes done) and if you know how many bytes there are at the start then you are on your way!
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Mar 10th, 2001, 05:07 PM
#10
Hyperactive Member
its not that simple sastraxi - look up the function in MSDN:
HRESULT URLDownloadToFile(
LPUNKNOWN pCaller,
LPCSTR szURL,
LPCSTR szFileName,
DWORD dwReserved,
LPBINDSTATUSCALLBACK lpfnCB
);
the last param is apparently:
Address of the caller's IBindStatusCallback interface. URLDownloadToFile calls this interface's IBindStatusCallback::OnProgress method on a connection activity, including the arrival of data. IBindStatusCallback::OnDataAvailable is never called. Implementing IBindStatusCallback::OnProgress allows a caller to implement a user interface or other progress monitoring functionality. It also allows the download operation to be canceled by returning E_ABORT from the IBindStatusCallback::OnProgress call. Can be NULL
So..i'd guess you'd need a class that implements this interface; thats in MSDN too. then you'd pass a pointer to an instance of that class?
Dim BindStatCB as new IBindStatusCallback
i.e. ObjPtr(BindStatCB)
If you can find a TLB/DLL that has IBindStatusCallback in it, then you don't have to write the class yourself.
NOTE: this probably won't work
buzzwords are the language of fools
-
Mar 10th, 2001, 10:12 PM
#11
PowerPoster
I think Fox you are already doing this, but can't you make a Dll/ocx in C/C++ which monitors the download (and which has a visible component ) and use it in your application. If you are doing this or are planning to do this, could you send me the dll/ocx also(I am not hat comfortabl with C)
-
Jul 18th, 2001, 04:40 PM
#12
Fanatic Member
 Looking for a friendly intelligent chat forum? Visit the white-hart.net 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|