[讨论]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);
使用进程条显示出下载这个文件的进度
第五个参数填法与接口回显的具体写法!!!
谢谢!!! MSDN..... 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. 自己按格式定义一个回调函数,然后把函数名放那里就OK了。
帮助里说设为NULL也可以的 我这里有一个完整的写法,并且有工程文件下载
下载地址:[url]http://www.maeee.cn/article/it/Cjj/html/2007101916111123.html[/url]
页:
[1]