Problem with call Log using CLogViewEvent
| Sat, 2005-07-16 12:51 | |
|
Hi All
This is my code for catching of every incomming, outgoing and missed calls, but it isn't work When application go to RunL IStatus != 0 ! I try to get event when iStatus is not kErrNone but event is empty.Any supossition ? Thanks a lot! #include <coemain.h> #include <etel.h> #include "FileManager.h" CallLogEngine::CallLogEngine():CActive(CActive::EPriorityStandard) { iState=EIdle; iLogClient=NULL; iRecentLogView=NULL; iLogFilter=NULL; CActiveScheduler::Add(this); } CallLogEngine* CallLogEngine::NewL() { CallLogEngine* self = new(ELeave)CallLogEngine(); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop(); return self; } void CallLogEngine::ConstructL() { iFsSession = CEikonEnv::Static()->FsSession(); iFsSession.Connect(); iLogClient = CLogClient::NewL(iFsSession); iRecentLogView = CLogViewEvent::NewL(*iLogClient); iLogFilter = CLogFilter::NewL(); iLogFilter->SetEventType(KLogCallEventTypeUid); RecentLogView->SetFilterL(*iLogFilter, iStatus); } CallLogEngine::~CallLogEngine(void) { Cancel(); delete iRecentLogView; delete iLogFilter, delete iLogClient; delete iLogEvent; iRecentLogView = NULL; iLogFilter = NULL; iLogClient = NULL; iLogEvent = NULL; } void CallLogEngine::RunL() { if (iStatus == KErrNone) { CLogEvent *event = CLogEvent::NewL(); event = (CLogEvent*)&iRecentLogView->Event(); FileManager::SaveText(event->Number()); } } TInt CallLogEngine::RunError(TInt) { return KErrNone; } void CallLogEngine::StartCallEngine() { Start(); } void CallLogEngine::Start() { if(!IsActive()) { SetActive(); } } |
|






When application go to RunL IStatus != 0 ! I try to get event when iStatus is not kErrNone but event is empty.
Forum posts: 26
CLogViewEvent is not positioned at any record yet.
in your Start() method do following
void CallLogEngine::Start() {
if(!IsActive())
{
iRecentLogView->FirstL(iStatus);
SetActive();
}
}
Hope this helps