Problem with call Log using CLogViewEvent

Login to reply to this topic.
Sat, 2005-07-16 12:51
Joined: 2005-07-07
Forum posts: 34
Hi All

This is my code for catching of every incomming, outgoing and missed calls, but it isn't work Sad  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();
   }
   
}



Tue, 2006-05-02 15:58
Joined: 2004-07-14
Forum posts: 26
Re: Problem with call Log using CLogViewEvent
Well,

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
Tue, 2006-05-02 18:50
Guest (not verified)
Forum posts: 2043
Re: Problem with call Log using CLogViewEvent
iStatus doesn't have to be KErrNone, it can be any value as long as its not KRequestPending. An error code value would of course indicate some error, but it could also contain some other value which isn't an error value. What is its value in this case and is it an error code value?
  • Login to reply to this topic.