91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

用于函數 STDAPI URLDownloadToFileW(LPUNKNOWN,LPCWSTR,LPCWSTR,DWORD,LPBINDSTATUSCALLBACK); LPBINDSTATUSCALLBACK參數的定義類
博客地址:https://blog.csdn.net/qiangzi4646/article/details/80667753

資源截圖

代碼片段和文件信息

#include?“stdafx.h“
#include?“BindStatusCallback.h“
#include?????????????????????//?for?StrFormatByteSize()

#ifdef?_DEBUG
#undef?THIS_FILE
static?char?THIS_FILE[]=__FILE__;
#define?new?DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
//?Construction/Destruction
//////////////////////////////////////////////////////////////////////

CCallback::CCallback()?:?m_bUseTimeout(FALSE)
{
}

CCallback::~CCallback()
{
}

HRESULT?CCallback::OnProgress?(?ULONG?ulProgress???ULONG?ulProgressMax
????????????????????????????????ULONG?ulStatusCode?LPCWSTR?wszStatusText?)
{
//?Local?variables?are?declared?static?so?they?don‘t?have?to?be?reallocated?on
//?the?stack?every?time.??This?is?safe?in?this?app?since?I?know?I‘ll?only?have
//?one?thread?downloading.
static?CString?sIEStatusMsg;
static?TCHAR???szCustomStatusMsg?[256];
static?TCHAR???szAmtDownloaded?[256]?szTotalSize?[256];

????UNREFERENCED_PARAMETER(ulStatusCode);

????//?Did?the?user?hit?the?Stop?button?
????//if?(?0?!=?g_fAbortDownload?)
????//????return?E_ABORT;

????//?Has?the?timeout?period?elapsed??超時停止下載
????if?(?m_bUseTimeout??&&??CTime::GetCurrentTime()?>?m_timeToStop?)
????????return?E_ABORT;

????//?Use?CString?to?convert?IE‘s?status?message?to?a?TCHAR?string.
????if?(?NULL?!=?wszStatusText?)
sIEStatusMsg?=?wszStatusText;
????else
????????sIEStatusMsg.Empty();

????//?Make?our?own?progress?message?-?we‘ll?show?the?amount?downloaded?and
????//?the?total?file?size?(if?known).

????StrFormatByteSize?(?ulProgress?szAmtDownloaded?256?);
????StrFormatByteSize?(?ulProgressMax?szTotalSize?256?);

////顯示進度
?//???if?(?0?!=?ulProgressMax?)
?//???????wsprintf?(?szCustomStatusMsg?_T(“Downloaded?%s?of?%s“)szAmtDownloaded?szTotalSize?);
?//???else
?//???????wsprintf?(?szCustomStatusMsg?_T(“Downloaded?%s?(total?size?unknown)“)szAmtDownloaded?);

????//?Report?the?progress?back?to?the?main?window.

????//if?(?0?!=?ulProgressMax?)
????//????{
????//????m_pDlg->ProgressUpdate?(?sIEStatusMsg?szCustomStatusMsg
????//?????????????????????????????int(?100.0?*?ulProgress?/?ulProgressMax)?);
????//????}
????//else
????//????{
????//????m_pDlg->ProgressUpdate?(?sIEStatusMsg?szCustomStatusMsg?0?);
????//????}

????return?S_OK;
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????2353??2018-04-24?14:22??BindStatusCallback.cpp

?????文件???????2519??2018-04-24?14:22??BindStatusCallback.h

-----------?---------??----------?-----??----

?????????????????4872????????????????????2


評論

共有 條評論