problem in calendar APIs

Login to reply to this topic.
Tue, 2008-03-11 06:05
Joined: 2007-09-19
Forum posts: 18

Hi,

I am trying to make an application that will read the store the reminders in the calendar. I read the sdk help provided for it and also hav gone through the sample program provided in Examples->AppEngine->Calinterimapi but when i try to modify my helloworld program using this, i am getting errors.

I wrote the following code in HandleCommandL():

CCalSession* calSession = CCalSession::NewL();
TFileName defaultCalendarFileName = calSession->DefaultFileNameL();
TRAP(err, calSession->CreateCalFileL(defaultCalendarFileName));
calSession->OpenL(defaultCalendarFileName);

//----- create a view for the entry
CCalEntryView* calEntryView = CCalEntryView::NewL(*calSession, *this); //------------line no.197

//------ creating a new event]
_LIT8(KGUID_CAL, "A_Global_UID");
HBufC8* uid = KGUID_CAL().AllocL();
CCalEntry* calEntry=calSession->NewL(CCalEntry::EEvent, uid, CCalEntry::EMethodNone, 0); //-----------line no. 203

delete calSession;

and I am getting the following errors:

1) 'CCalSession::NewL()' (static) [ in line no. 203]
2) 'MCalProgressCallBack &' [ in line no. 197]
3) function call 'NewL(CCalEntry::TType, {lval} HBufC8 *, CCalEntry::TMethod, int)' does not match [ in line no. 203]
4) illegal implicit conversion from 'CHelloWorldBasicAppUi' to [ in line no. 197]

Please help..

thanx


Tue, 2008-03-11 07:53
Joined: 2006-04-19
Forum posts: 155
Re: problem in calendar APIs

Hi

Please check this line again

CCalEntry* calEntry=calSession->NewL(CCalEntry::EEvent, uid, CCalEntry::EMethodNone, 0);

I think it should be like this

CCalEntry* calEntry=CCalEntry :: NewL(CCalEntry::EEvent, uid, CCalEntry::EMethodNone, 0); // As NewL is a static method moreover u are using calSession->NewL // here is newl is also a static method and moreover it'll return the object of CCalSession instead of CCalEntry.

Hope it'll work .

Regards,
Isha


"To the question of your life , you are the only Answer. To the problems of your life,you are the only Solution".

  • Login to reply to this topic.