本文整理汇总了C++中Cancel函数的典型用法代码示例。如果您正苦于以下问题:C++ Cancel函数的具体用法?C++ Cancel怎么用?C++ Cancel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Cancel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Cancel
QWakeUpActiveObject::~QWakeUpActiveObject()
{
Cancel();
}
示例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;
}
//.........这里部分代码省略.........
示例3: Cancel
cDeCsaTSBuffer::~cDeCsaTSBuffer()
{
Cancel(3);
if(decsa) decsa->SetActive(false);
delete ringBuffer;
}
示例4: Cancel
CSwiTask::~CSwiTask()
{
Cancel();
}
示例5: Cancel
void DtSetModList::CloseCB()
{
Cancel();
}
示例6: Cancel
CCheckNetwork::~CCheckNetwork()
{
Cancel(); // if any request outstanding, calls DoCancel() to cleanup
delete iTelephony;
delete iPkg;
}
示例7: Cancel
// -----------------------------------------------------------------------------
// CMyLocationsEngine::~CCalenderNotification()
// default destuctor.
// -----------------------------------------------------------------------------
//
CCalenderNotification::~CCalenderNotification()
{
Cancel();
iFsession.Close();
}
示例8: __CONNECTIONMULTIPLEXER
// ---------------------------------------------------------------------------
// CNcmReceiver::~CNcmReceiver
// ---------------------------------------------------------------------------
//
CNcmReceiver::~CNcmReceiver()
{
__CONNECTIONMULTIPLEXER( "CNcmReceiver::~CNcmReceiver" )
Cancel();
}
示例9: Cancel
/**
* Standard destructor.
*/
CSmsMessageSend::~CSmsMessageSend()
{
Cancel();
delete iSmsEventLogger;
} // CSmsMessageSend::~CSmsMessageSend
示例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
//.........这里部分代码省略.........
示例11: Cancel
cThread::~cThread()
{
Cancel(); // just in case the derived class didn't call it
free(description);
}
示例12: Cancel
QMLBackendMonitorAO::~QMLBackendMonitorAO()
{
Cancel();
delete iTriggerMonitorInfo; //deletes the CBackendMonitorInfo object holding the linked list
iLbt.Close(); //closes the subsession
}
示例13: Cancel
// Destructor
CPhCltComHandRequestMonitor::~CPhCltComHandRequestMonitor()
{
Cancel();
}
示例14: Cancel
CStateRefAdaptationTimer::~CStateRefAdaptationTimer()
{
Cancel();
}
示例15: Cancel
CCopyContactsAO::~CCopyContactsAO()
{
Cancel();
delete iDatabase;
}