您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Cancel函数代码示例

51自学网 2021-06-01 20:09:20
  C++
这篇教程C++ Cancel函数代码示例写得很实用,希望能帮到您。

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

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

示例1: Cancel

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


示例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,


示例3: Cancel

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


示例4: Cancel

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


示例5: Cancel

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


示例6: Cancel

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


示例7: Cancel

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


示例8: __CONNECTIONMULTIPLEXER

// ---------------------------------------------------------------------------// CNcmReceiver::~CNcmReceiver// ---------------------------------------------------------------------------//CNcmReceiver::~CNcmReceiver()    {    __CONNECTIONMULTIPLEXER( "CNcmReceiver::~CNcmReceiver" )    Cancel();    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:10,


示例9: Cancel

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


示例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,


示例11: Cancel

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


示例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,


示例13: Cancel

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


示例14: Cancel

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


示例15: Cancel

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


示例16: Cancel

// ---------------------------------------------------------------------------// NewL// ---------------------------------------------------------------------------//CSendUiEcomObserver::~CSendUiEcomObserver(){    Cancel();}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:8,


示例17: Cancel

CCamcTestClient_9::~CCamcTestClient_9 ()    {    Cancel();    delete iCamc;    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:5,


示例18: LockMe

void JobManager::DoShutdown(){  std::vector<InternalJob::Pointer> vec_ToCancel;  {    Poco::ScopedLock<Poco::Mutex> LockMe(m_mutex);    if (m_active)    {      m_active = false;      //cancel all running jobs      vec_ToCancel.assign(m_running.begin(), m_running.end());      //clean up      m_JobQueueSleeping.Clear();      m_JobQueueWaiting.Clear();      m_running.clear();    }  }  // Give running jobs a chance to finish. Wait 0.1 seconds for up to 3 times.  if (!vec_ToCancel.empty())  {    for (std::size_t i = 0; i < vec_ToCancel.size(); i++)    {      // cancel jobs outside sync block to avoid deadlock      Cancel(vec_ToCancel[i]);    }    for (int waitAttempts = 0; waitAttempts < 3; waitAttempts++)    {      Poco::Thread::yield();      {        Poco::ScopedLock<Poco::Mutex> LockMe(m_mutex);        if (m_running.empty())          break;      }      if (DEBUG_SHUTDOWN)      {        //  JobManager.debug("Shutdown - job wait cycle #" + (waitAttempts + 1));         std::vector<InternalJob::Pointer> vec_StillRunning;        {          Poco::ScopedLock<Poco::Mutex> LockMe(m_mutex);          vec_StillRunning.assign(m_running.begin(), m_running.end());          //   if (!vec_StillRunning.empty()) {          //for (int j = 0; j < stillRunning.length; j++) {          //  JobManager.debug("/tJob: " + printJobName(stillRunning[j])); //$NON-NLS-1$          //}        }      }      Poco::Thread::sleep(100);      Poco::Thread::yield();    }    // retrieve list of the jobs that are still running    {      Poco::ScopedLock<Poco::Mutex> LockMe(m_mutex);      vec_ToCancel.assign(m_running.begin(), m_running.end());    }  }  if (!vec_ToCancel.empty())  {    /*for (int i = 0; i < vec_ToCancel.size(); i++) {*/    //  std::string  tmp_jobName = PrintJobName(toCancel[i]);    //        //this doesn't need to be translated because it's just being logged    //        String msg = "Job found still running after platform shutdown.  Jobs should be canceled by the plugin that    //        scheduled them during shutdown: " + jobName;    //        RuntimeLog.log(new Status(IStatus.WARNING, JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, msg, null));    //    //        // TODO the RuntimeLog.log in its current implementation won't produce a log    //        // during this stage of shutdown. For now add a standard error output.    //        // One the logging story is improved, the System.err output below can be removed:    //        System.err.println(msg);    //      }  }  m_Pool->Shutdown();}
开发者ID:test-fd301,项目名称:MITK,代码行数:77,


示例19: Cancel

void CSocketsWriter::TimerExpired()    {	Cancel();	iWriteStatus = EWaiting;    iEngineNotifier.ReportError(MEngineNotifier::ETimeOutOnWrite, KErrTimedOut);    }
开发者ID:AnthonyNystrom,项目名称:MobiVU,代码行数:6,


示例20: Cancel

// ---------------------------------------------------------------------------// CSsmLangSelCmd::ExecuteCancel// ---------------------------------------------------------------------------//void CSsmLangSelCmd::ExecuteCancel()    {    FUNC_LOG;    Cancel();    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:10,


示例21: Cancel

CMdSGarbageCollector::~CMdSGarbageCollector()	{	Cancel();	iTimer.Close();	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:5,


示例22: Cancel

// -----------------------------------------------------------------------------// CBassBoostEventObserver::~CBassBoostEventObserver// Destructor// -----------------------------------------------------------------------------//CBassBoostEventObserver::~CBassBoostEventObserver()    {    // We should not have to cancel the outstanding request because the message    // handler will complete our request with KErrCancel in its destructor.    Cancel();    }
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:11,


示例23: Cancel

void CInstance::Fail(){	Cancel();	luautils::OnInstanceFailure(this);}
开发者ID:Celyste,项目名称:darkstar,代码行数:6,


示例24: Cancel

CGuiCommand::~CGuiCommand(){	Cancel();	pCommand->Release();	pCommand=NULL;}
开发者ID:darwinbeing,项目名称:trade,代码行数:6,



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


C++ CancelEvents函数代码示例
C++ CanUndo函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。