void CCatalogsLoggerMsgQueueObserver::SendFileL() { TBool wasLogging = IsLogging(); if( IsLogging() ) { StopLogging(); } iLogFile.Close(); iObexSender = COsmObexSender::NewL( *this ); iObexSender->SendFileL( COsmObexSender::EOsmConnectionBT, iLogFileName ); CActiveScheduler::Start(); User::LeaveIfError( iObexSendError ); User::LeaveIfError( iLogFile.Open( iFs, iLogFileName, EFileShareAny | EFileWrite ) ); TInt pos = 0; User::LeaveIfError( iLogFile.Seek( ESeekEnd, pos ) ); if( wasLogging ) { StartLogging(); } }
void CMainFrame::OnUpdateLogged(CCmdUI* pUI) { char buff[32]; int Data; int val = m_wndStatusBar.GetStatusBarCtrl ().GetText(buff, NUM_INDICATOR_LOGGED, &Data); BOOL bLog = IsLogging(); if ( (bLog && val ) || (!bLog && !val) ) return ; m_wndStatusBar.GetStatusBarCtrl ().SetText((char*)bLog, NUM_INDICATOR_LOGGED, SBT_OWNERDRAW ); }
int CIWTransaction::New(CStdString sTransactionType, CIWVerification *pIWVer) { int nRet = IW_SUCCESS; // Every transaction has exactly one Type-1 record, so we add it automatically. CNISTRecord *pRec1 = new CNISTRecord; if (pRec1) { pRec1->InitializeNewRecord(RECORD_TYPE1); pRec1->SetRecordType(RECORD_TYPE1); pRec1->SetItem(sTransactionType, TYPE1_TOT, 1, 1); m_RecordAry.push_back(pRec1); m_pVerification = pIWVer; m_bTransactionLoaded = true; m_nIDCSequence = 0; // reset the IDC sequence #ifdef UNICODE // In the UNICODE version we specify that we will be writing UTF-8 chars into fields Set(L"T1_DCS_CSI", L"003", 1, 1); // Character Set Index is "003" for UTF-8 Set(L"T1_DCS_CSN", L"UTF-8", 1, 1); // Character Set Name #endif } if (IsLogging()) { CStdString sLogMessage; sLogMessage.Format(IDS_LOGTRANSNEW, nRet); LogMessage(sLogMessage); } return nRet; }
void CJMCStatus::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) { static int count = 0; HBITMAP hb; switch ( lpDrawItemStruct->itemID ) { case NUM_INDICATOR_INFO1: { DrawColoredText(lpDrawItemStruct, ((CMainFrame*)AfxGetMainWnd())->m_strInfo1); } return; case NUM_INDICATOR_INFO2: { DrawColoredText(lpDrawItemStruct, ((CMainFrame*)AfxGetMainWnd())->m_strInfo2); } return; case NUM_INDICATOR_INFO3: { DrawColoredText(lpDrawItemStruct, ((CMainFrame*)AfxGetMainWnd())->m_strInfo3); } return; case NUM_INDICATOR_INFO4: { DrawColoredText(lpDrawItemStruct, ((CMainFrame*)AfxGetMainWnd())->m_strInfo4); } return; case NUM_INDICATOR_INFO5: { DrawColoredText(lpDrawItemStruct, ((CMainFrame*)AfxGetMainWnd())->m_strInfo5); } return; case NUM_INDICATOR_CONNECTED: { if ( IsConnected() ) { hb = (HBITMAP)m_bmpConnected; break; } } return; case NUM_INDICATOR_LOGGED: { if ( IsLogging() ) { hb = (HBITMAP)m_bmpLogged; break; } } return; case NUM_PATH_WRITING: { if ( IsPathing () ) { hb = (HBITMAP)m_bmpMarked; break; } } return; default: return; } HDC dc = CreateCompatibleDC (lpDrawItemStruct->hDC ); SelectObject(dc, hb); BitBlt(lpDrawItemStruct->hDC, lpDrawItemStruct->rcItem.left, lpDrawItemStruct->rcItem.top, lpDrawItemStruct->rcItem.right - lpDrawItemStruct->rcItem.left, lpDrawItemStruct->rcItem.bottom- lpDrawItemStruct->rcItem.top, dc, 0, 0 , SRCCOPY); DeleteDC(dc); return; }