邪恶八进制信息安全团队技术讨论组's Archiver

冰火亮 2007-5-2 16:04

[讨论]VC/MFC URLDownloadToFile下载文件显示进度写法

议题作者:冰火亮
信息来源:邪恶八进制信息安全团队([url]www.eviloctal.com[/url])

HRESULT URLDownloadToFile(     LPUNKNOWN pCaller,
  LPCTSTR szURL,
  LPCTSTR szFileName,
  DWORD dwReserved,
  LPBINDSTATUSCALLBACK lpfnCB
);

HRESULT ret;
ret = URLDownloadToFile(NULL,"http://flstx.com/soft.exe", "C:\\soft.exe",0,NULL);

使用进程条显示出下载这个文件的进度

第五个参数填法与接口回显的具体写法!!!

谢谢!!!

gyzy 2007-5-9 14:39

MSDN.....

寂寞宝贝 2007-5-9 21:34

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. This can be set to NULL.

寂寞宝贝 2007-5-9 22:11

自己按格式定义一个回调函数,然后把函数名放那里就OK了。
帮助里说设为NULL也可以的

rzwince 2007-10-20 09:45

我这里有一个完整的写法,并且有工程文件下载
下载地址:[url]http://www.maeee.cn/article/it/Cjj/html/2007101916111123.html[/url]

页: [1]
© 1999-2008 EvilOctal Security Team