当前位置: 首页>>代码示例>>C++>>正文


C++ Cancel函数代码示例

本文整理汇总了C++中Cancel函数的典型用法代码示例。如果您正苦于以下问题:C++ Cancel函数的具体用法?C++ Cancel怎么用?C++ Cancel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Cancel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Cancel

QWakeUpActiveObject::~QWakeUpActiveObject()
{
    Cancel();
}
开发者ID:NikhilNJ,项目名称:screenplay-dx,代码行数:4,代码来源:qeventdispatcher_symbian.cpp

示例2: UpdateCommandButton

void CUpdateThread::Update()
{
	// 读取本地配置
	UpdateCommandButton(COMMAND_BUTTON_CANCEL);
	UpdateMainProgress(0);
	UpdateSubProgress(0);

	UpdateStatusText(_T("读取站点列表……"));
	CString strIniPath = theApp.GetProfileFile();
	CString strSites;
	DWORD dwSize = 0;
	do 
	{
		dwSize += 4096;
	} while(GetPrivateProfileSection(_T("Sites"), strSites.GetBuffer(dwSize), dwSize, strIniPath.GetString()) == dwSize - 2);
	UpdateSubProgress(100);

	CArray<CString> sites;
	LPCTSTR lpszSite = strSites.GetBuffer();
	while (lpszSite[0]) 
	{
		sites.Add(lpszSite);
		lpszSite += _tcslen(lpszSite) + 1;
	}
	strSites.ReleaseBuffer();

	UpdateMainProgress(2);

	CMap<CString, LPCTSTR, AddonFile, AddonFile&> files;
	// 下载文件列表
	double step = 6.0 / sites.GetSize();
	for (int i = 0; i < sites.GetSize() && CheckCancel(); ++i) 
	{
		CString &strSite = sites.GetAt(i);
		if (!GetFileList(strSite, files))
		{
			UpdateSubProgress(100);
			UpdateMainProgress(100);
			UpdateStatusText(_T("无法下载文件列表。"));
			return;
		}
		UpdateMainProgress(2 + (int)(step * i + 0.5));
	}
	if (!CheckCancel())
		return;
	UpdateMainProgress(8);
		
	UpdateStatusText(_T("正在检测需要更新的文件……"));

	CString strWOWPath = theApp.GetWOWPath();
	CString strTempPath = theApp.GetTempPath();
	CArray <AddonFile *> aDownloadList;
	// 需要下载的文件
	CMap<CString, LPCTSTR, AddonFile, AddonFile&>::CPair *pair = files.PGetFirstAssoc();
	while (pair && CheckCancel())
	{
		CString strMD5;
		try 
		{
			CString strFilePath;
			strFilePath.Append(strWOWPath);
			strFilePath.Append(pair->value.m_strPath);
			md5_state_t md5;
			md5_init(&md5);
			md5_byte_t digest[16] = {0};
			CFile file(strFilePath, CFile::shareDenyRead | CFile::modeRead);
			char buf[4096];
			UINT nCount;
			while ((nCount = file.Read(buf, 4096)) > 0)
			{
				md5_append(&md5, buf, nCount);	
			}
			file.Close();
			md5_finish(&md5, digest);
			for (int i = 0; i < 16; ++i)
			{
				strMD5.AppendFormat(_T("%02x"), digest[i]);
			}
		}
		catch (CFileException *e)
		{
			e->Delete();
		}
		if (strMD5.Compare(pair->value.m_strMD5) != 0)
		{
			aDownloadList.Add(&pair->value);
		}

		pair = files.PGetNextAssoc(pair);
	}

	if (!CheckCancel())
		return;

	ULONG uTotalSize = 0;
	for (int i = 0; i < aDownloadList.GetSize(); ++i)
	{
		uTotalSize += aDownloadList.GetAt(i)->m_uCompressedSize;
	}

//.........这里部分代码省略.........
开发者ID:wyx1987,项目名称:AddonUpdator,代码行数:101,代码来源:UpdateThread.cpp

示例3: Cancel

cDeCsaTSBuffer::~cDeCsaTSBuffer()
{
  Cancel(3);
  if(decsa) decsa->SetActive(false);
  delete ringBuffer;
}
开发者ID:Saner2oo2,项目名称:descrambler,代码行数:6,代码来源:device.c

示例4: Cancel

CSwiTask::~CSwiTask()
	{	
	Cancel();
	}
开发者ID:fedor4ever,项目名称:packaging,代码行数:4,代码来源:SwiTask.cpp

示例5: Cancel

void DtSetModList::CloseCB()
{
   Cancel();
}
开发者ID:osen,项目名称:cdesktopenv,代码行数:4,代码来源:DtSetModList.C

示例6: Cancel

CCheckNetwork::~CCheckNetwork()
{
    Cancel(); // if any request outstanding, calls DoCancel() to cleanup
    delete iTelephony;
    delete iPkg;
}
开发者ID:deepakprabhakara,项目名称:ripplevault,代码行数:6,代码来源:checknetwork.cpp

示例7: Cancel

// -----------------------------------------------------------------------------
// CMyLocationsEngine::~CCalenderNotification()
// default destuctor.
// -----------------------------------------------------------------------------
//
CCalenderNotification::~CCalenderNotification()
{
    Cancel();
    iFsession.Close();
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:10,代码来源:calendernotification.cpp

示例8: __CONNECTIONMULTIPLEXER

// ---------------------------------------------------------------------------
// CNcmReceiver::~CNcmReceiver
// ---------------------------------------------------------------------------
//
CNcmReceiver::~CNcmReceiver()
    {
    __CONNECTIONMULTIPLEXER( "CNcmReceiver::~CNcmReceiver" )

    Cancel();
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:10,代码来源:cncmreceiver.cpp

示例9: Cancel

/**
 *  Standard destructor.
 */
CSmsMessageSend::~CSmsMessageSend()
{
    Cancel();
    delete iSmsEventLogger;
} // CSmsMessageSend::~CSmsMessageSend
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:8,代码来源:smspsend.cpp

示例10: switch

void CSTTrackerConnection::MHFRunL(RHTTPTransaction aTransaction, 
						  			const THTTPEvent& aEvent)
{
	switch (aEvent.iStatus)
	{
		case THTTPEvent::EGotResponseHeaders:
		{
			// HTTP response headers have been received. Use
			// aTransaction.Response() to get the response. However, it's not
			// necessary to do anything with the response when this event occurs.

			LWRITELN(iLog, _L("[Trackerconnection] Got HTTP headers"));
			// Get HTTP status code from header (e.g. 200)
			RHTTPResponse resp = aTransaction.Response();
			TInt status = resp.StatusCode();
			
			if (status != 200) // ERROR, hiba esetén mi legyen? 404-et lekezelni!
			{
				LWRITE(iLog, _L("[Trackerconnection] Error, status = "));
				TBuf<20> numBuf;
				numBuf.Num(status);
				LWRITELN(iLog, numBuf);
				Cancel();
				if (iObserver)
					iObserver->TrackerConnectionFailedL();
				break;
			}

			// Get status text (e.g. "OK")
			HLWRITE(iLog, _L("[Trackerconnection] Status text = "));
			TBuf<32> statusText;
			statusText.Copy(resp.StatusText().DesC());
			HLWRITELN(iLog, statusText);
			
			
			#ifdef LOG_TO_FILE
			RHTTPHeaders headers = 
				aTransaction.Response().GetHeaderCollection();		
			THTTPHdrFieldIter i =
				headers.Fields();
			for (i.First(); !(i.AtEnd()); ++i)
			{
				RStringF header = iSession.StringPool().StringF(i());
				
				if ((header.DesC() == _L8("Content-Type")))
				{
					HLWRITE(iLog, header.DesC());
					HLWRITE(iLog, _L(": "));
					THTTPHdrVal	val;
					headers.GetField(header, 0, val);
					RStringF value = val.StrF();
					HLWRITELN(iLog, value.DesC());
				}
				else
					HLWRITELN(iLog, header.DesC());
			}
						
			#endif
		}
		break;

		case THTTPEvent::EGotResponseBodyData:
		{			
			// Part (or all) of response's body data received. Use 
			// aTransaction.Response().Body()->GetNextDataPart() to get the actual
			// body data.						

			// Get the body data supplier
			MHTTPDataSupplier* body = aTransaction.Response().Body();
			TPtrC8 dataChunk;						

			// GetNextDataPart() returns ETrue, if the received part is the last 
			// one.
			TBool isLast = body->GetNextDataPart(dataChunk);
			
			//iDownloadedSize += dataChunk.Size();						
			
			HLWRITELN(iLog, _L8("[TrackerConnection] HTTP response body chunk received: "));
			HLWRITELN(iLog, dataChunk);
			
			if (iReceiveBuffer)
			{
				HBufC8* temp = HBufC8::NewL(
					iReceiveBuffer->Length() + dataChunk.Length());
				TPtr8 tempPtr(temp->Des());
				tempPtr.Copy(*iReceiveBuffer);
				tempPtr.Append(dataChunk);
				
				delete iReceiveBuffer;
				iReceiveBuffer = temp;
			}
			else
				iReceiveBuffer = dataChunk.AllocL();

			// Always remember to release the body data.
			body->ReleaseData();
		
			// NOTE: isLast may not be ETrue even if last data part received.
			// (e.g. multipart response without content length field)
			// Use EResponseComplete to reliably determine when body is completely
//.........这里部分代码省略.........
开发者ID:Nokia700,项目名称:SymTorrent,代码行数:101,代码来源:STTrackerConnection.cpp

示例11: Cancel

cThread::~cThread()
{
  Cancel(); // just in case the derived class didn't call it
  free(description);
}
开发者ID:nvertigo,项目名称:vdr,代码行数:5,代码来源:thread.c

示例12: Cancel

QMLBackendMonitorAO::~QMLBackendMonitorAO()
{
    Cancel();
    delete iTriggerMonitorInfo; //deletes the CBackendMonitorInfo object holding the linked list
    iLbt.Close();   //closes the subsession
}
开发者ID:RobinD42,项目名称:qt-mobility,代码行数:6,代码来源:qmlbackendmonitorao_s60.cpp

示例13: Cancel

    // Destructor
CPhCltComHandRequestMonitor::~CPhCltComHandRequestMonitor()
    {  
    Cancel();
    }
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:5,代码来源:cphcltcomhandrequestmonitor.cpp

示例14: Cancel

CStateRefAdaptationTimer::~CStateRefAdaptationTimer()
	{
	Cancel();	
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:4,代码来源:stateadaptationref.cpp

示例15: Cancel

CCopyContactsAO::~CCopyContactsAO()
{
	Cancel();
	delete iDatabase;
}
开发者ID:deepakprabhakara,项目名称:ripplevault,代码行数:5,代码来源:copycontactsao.cpp


注:本文中的Cancel函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。